index.js 162.6 KB
Newer Older
D
dolymood 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, {
/******/ 				configurable: false,
/******/ 				enumerable: true,
/******/ 				get: getter
/******/ 			});
/******/ 		}
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "./";
/******/
/******/ 	// Load entry module and return exports
A
AmyFoxFN 已提交
64
/******/ 	return __webpack_require__(__webpack_require__.s = 272);
D
dolymood 已提交
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports) {

// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global = module.exports = typeof window != 'undefined' && window.Math == Math
  ? window : typeof self != 'undefined' && self.Math == Math ? self
  // eslint-disable-next-line no-new-func
  : Function('return this')();
if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef


/***/ }),
/* 1 */
/***/ (function(module, exports) {

/* globals __VUE_SSR_CONTEXT__ */

// this module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle

module.exports = function normalizeComponent (
  rawScriptExports,
  compiledTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */
) {
  var esModule
  var scriptExports = rawScriptExports = rawScriptExports || {}

  // ES6 modules interop
  var type = typeof rawScriptExports.default
  if (type === 'object' || type === 'function') {
    esModule = rawScriptExports
    scriptExports = rawScriptExports.default
  }

  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (compiledTemplate) {
    options.render = compiledTemplate.render
    options.staticRenderFns = compiledTemplate.staticRenderFns
  }

  // scopedId
  if (scopeId) {
    options._scopeId = scopeId
  }

  var hook
  if (moduleIdentifier) { // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = injectStyles
  }

  if (hook) {
    var functional = options.functional
    var existing = functional
      ? options.render
      : options.beforeCreate
    if (!functional) {
      // inject component registration as beforeCreate hook
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    } else {
      // register for functioal component in vue file
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return existing(h, context)
      }
    }
  }

  return {
    esModule: esModule,
    exports: scriptExports,
    options: options
  }
}


A
AmyFoxFN 已提交
176 177 178 179
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
180 181 182 183 184 185 186 187 188 189 190
var store = __webpack_require__(25)('wks');
var uid = __webpack_require__(20);
var Symbol = __webpack_require__(0).Symbol;
var USE_SYMBOL = typeof Symbol == 'function';

var $exports = module.exports = function (name) {
  return store[name] || (store[name] =
    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
};

$exports.store = store;
A
AmyFoxFN 已提交
191 192


D
dolymood 已提交
193 194 195 196
/***/ }),
/* 3 */
/***/ (function(module, exports) {

A
AmyFoxFN 已提交
197
var core = module.exports = { version: '2.5.3' };
D
dolymood 已提交
198 199 200
if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef


D
dolymood 已提交
201 202
/***/ }),
/* 4 */
A
AmyFoxFN 已提交
203 204
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
205 206 207 208
// Thank's IE8 for his funny defineProperty
module.exports = !__webpack_require__(9)(function () {
  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
});
A
AmyFoxFN 已提交
209 210 211 212


/***/ }),
/* 5 */
D
dolymood 已提交
213 214 215 216 217 218 219 220
/***/ (function(module, exports) {

module.exports = function (it) {
  return typeof it === 'object' ? it !== null : typeof it === 'function';
};


/***/ }),
A
AmyFoxFN 已提交
221
/* 6 */
D
dolymood 已提交
222 223
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
224
var dP = __webpack_require__(7);
A
AmyFoxFN 已提交
225
var createDesc = __webpack_require__(15);
A
AmyFoxFN 已提交
226
module.exports = __webpack_require__(4) ? function (object, key, value) {
D
dolymood 已提交
227 228 229 230 231 232 233 234
  return dP.f(object, key, createDesc(1, value));
} : function (object, key, value) {
  object[key] = value;
  return object;
};


/***/ }),
A
AmyFoxFN 已提交
235
/* 7 */
D
dolymood 已提交
236 237
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
238
var anObject = __webpack_require__(8);
A
AmyFoxFN 已提交
239 240
var IE8_DOM_DEFINE = __webpack_require__(33);
var toPrimitive = __webpack_require__(30);
D
dolymood 已提交
241 242
var dP = Object.defineProperty;

A
AmyFoxFN 已提交
243
exports.f = __webpack_require__(4) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
D
dolymood 已提交
244 245 246 247 248 249 250 251 252 253 254 255 256
  anObject(O);
  P = toPrimitive(P, true);
  anObject(Attributes);
  if (IE8_DOM_DEFINE) try {
    return dP(O, P, Attributes);
  } catch (e) { /* empty */ }
  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
  if ('value' in Attributes) O[P] = Attributes.value;
  return O;
};


/***/ }),
A
AmyFoxFN 已提交
257
/* 8 */
A
AmyFoxFN 已提交
258 259
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
260
var isObject = __webpack_require__(5);
A
AmyFoxFN 已提交
261
module.exports = function (it) {
A
AmyFoxFN 已提交
262 263
  if (!isObject(it)) throw TypeError(it + ' is not an object!');
  return it;
A
AmyFoxFN 已提交
264 265 266 267
};


/***/ }),
A
AmyFoxFN 已提交
268
/* 9 */
A
AmyFoxFN 已提交
269 270
/***/ (function(module, exports) {

A
AmyFoxFN 已提交
271 272 273 274 275 276
module.exports = function (exec) {
  try {
    return !!exec();
  } catch (e) {
    return true;
  }
A
AmyFoxFN 已提交
277 278 279
};


D
dolymood 已提交
280
/***/ }),
A
AmyFoxFN 已提交
281
/* 10 */
A
AmyFoxFN 已提交
282 283
/***/ (function(module, exports) {

A
AmyFoxFN 已提交
284 285 286
var hasOwnProperty = {}.hasOwnProperty;
module.exports = function (it, key) {
  return hasOwnProperty.call(it, key);
A
AmyFoxFN 已提交
287 288 289 290
};


/***/ }),
A
AmyFoxFN 已提交
291
/* 11 */
D
dolymood 已提交
292 293
/***/ (function(module, exports, __webpack_require__) {

D
dolymood 已提交
294
var global = __webpack_require__(0);
D
dolymood 已提交
295
var core = __webpack_require__(3);
A
AmyFoxFN 已提交
296 297
var ctx = __webpack_require__(21);
var hide = __webpack_require__(6);
D
dolymood 已提交
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
var PROTOTYPE = 'prototype';

var $export = function (type, name, source) {
  var IS_FORCED = type & $export.F;
  var IS_GLOBAL = type & $export.G;
  var IS_STATIC = type & $export.S;
  var IS_PROTO = type & $export.P;
  var IS_BIND = type & $export.B;
  var IS_WRAP = type & $export.W;
  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
  var expProto = exports[PROTOTYPE];
  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
  var key, own, out;
  if (IS_GLOBAL) source = name;
  for (key in source) {
    // contains in native
    own = !IS_FORCED && target && target[key] !== undefined;
    if (own && key in exports) continue;
    // export native or passed
    out = own ? target[key] : source[key];
    // prevent global pollution for namespaces
    exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
    // bind timers to global for call from export context
    : IS_BIND && own ? ctx(out, global)
    // wrap global constructors for prevent change them in library
    : IS_WRAP && target[key] == out ? (function (C) {
      var F = function (a, b, c) {
        if (this instanceof C) {
          switch (arguments.length) {
            case 0: return new C();
            case 1: return new C(a);
            case 2: return new C(a, b);
          } return new C(a, b, c);
        } return C.apply(this, arguments);
      };
      F[PROTOTYPE] = C[PROTOTYPE];
      return F;
    // make static versions for prototype methods
    })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
    // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
    if (IS_PROTO) {
      (exports.virtual || (exports.virtual = {}))[key] = out;
      // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
      if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
    }
  }
};
// type bitmap
$export.F = 1;   // forced
$export.G = 2;   // global
$export.S = 4;   // static
$export.P = 8;   // proto
$export.B = 16;  // bind
$export.W = 32;  // wrap
$export.U = 64;  // safe
$export.R = 128; // real proto method for `library`
module.exports = $export;


A
AmyFoxFN 已提交
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391
/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {

// to indexed object, toObject with fallback for non-array-like ES3 strings
var IObject = __webpack_require__(23);
var defined = __webpack_require__(13);
module.exports = function (it) {
  return IObject(defined(it));
};


/***/ }),
/* 13 */
/***/ (function(module, exports) {

// 7.2.1 RequireObjectCoercible(argument)
module.exports = function (it) {
  if (it == undefined) throw TypeError("Can't call method on  " + it);
  return it;
};


/***/ }),
/* 14 */
/***/ (function(module, exports) {

// 7.1.4 ToInteger
var ceil = Math.ceil;
var floor = Math.floor;
module.exports = function (it) {
  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
};


D
dolymood 已提交
392
/***/ }),
A
AmyFoxFN 已提交
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407
/* 15 */
/***/ (function(module, exports) {

module.exports = function (bitmap, value) {
  return {
    enumerable: !(bitmap & 1),
    configurable: !(bitmap & 2),
    writable: !(bitmap & 4),
    value: value
  };
};


/***/ }),
/* 16 */
D
dolymood 已提交
408 409
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
410 411
var shared = __webpack_require__(25)('keys');
var uid = __webpack_require__(20);
A
AmyFoxFN 已提交
412 413 414 415 416 417 418
module.exports = function (key) {
  return shared[key] || (shared[key] = uid(key));
};


/***/ }),
/* 17 */
A
AmyFoxFN 已提交
419
/***/ (function(module, exports, __webpack_require__) {
A
AmyFoxFN 已提交
420

A
AmyFoxFN 已提交
421 422
// 7.1.13 ToObject(argument)
var defined = __webpack_require__(13);
D
dolymood 已提交
423
module.exports = function (it) {
A
AmyFoxFN 已提交
424
  return Object(defined(it));
D
dolymood 已提交
425 426 427
};


D
dolymood 已提交
428
/***/ }),
A
AmyFoxFN 已提交
429
/* 18 */
D
dolymood 已提交
430 431
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
432 433 434 435 436 437
// 19.1.2.14 / 15.2.3.14 Object.keys(O)
var $keys = __webpack_require__(34);
var enumBugKeys = __webpack_require__(26);

module.exports = Object.keys || function keys(O) {
  return $keys(O, enumBugKeys);
D
dolymood 已提交
438 439 440 441
};


/***/ }),
A
AmyFoxFN 已提交
442 443
/* 19 */
/***/ (function(module, exports) {
D
dolymood 已提交
444

A
AmyFoxFN 已提交
445 446 447 448 449 450 451 452 453 454 455
var toString = {}.toString;

module.exports = function (it) {
  return toString.call(it).slice(8, -1);
};


/***/ }),
/* 20 */
/***/ (function(module, exports) {

A
AmyFoxFN 已提交
456 457
var id = 0;
var px = Math.random();
D
dolymood 已提交
458
module.exports = function (key) {
A
AmyFoxFN 已提交
459
  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
D
dolymood 已提交
460 461 462 463
};


/***/ }),
A
AmyFoxFN 已提交
464
/* 21 */
D
dolymood 已提交
465 466
/***/ (function(module, exports, __webpack_require__) {

D
dolymood 已提交
467
// optional / simple context binding
A
AmyFoxFN 已提交
468
var aFunction = __webpack_require__(28);
D
dolymood 已提交
469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
module.exports = function (fn, that, length) {
  aFunction(fn);
  if (that === undefined) return fn;
  switch (length) {
    case 1: return function (a) {
      return fn.call(that, a);
    };
    case 2: return function (a, b) {
      return fn.call(that, a, b);
    };
    case 3: return function (a, b, c) {
      return fn.call(that, a, b, c);
    };
  }
  return function (/* ...args */) {
    return fn.apply(that, arguments);
  };
};


/***/ }),
A
AmyFoxFN 已提交
490 491
/* 22 */
/***/ (function(module, exports) {
D
dolymood 已提交
492

A
AmyFoxFN 已提交
493
module.exports = {};
D
dolymood 已提交
494 495 496


/***/ }),
A
AmyFoxFN 已提交
497
/* 23 */
D
dolymood 已提交
498
/***/ (function(module, exports, __webpack_require__) {
D
dolymood 已提交
499

A
AmyFoxFN 已提交
500 501 502 503 504
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var cof = __webpack_require__(19);
// eslint-disable-next-line no-prototype-builtins
module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
  return cof(it) == 'String' ? it.split('') : Object(it);
D
dolymood 已提交
505 506 507 508
};


/***/ }),
A
AmyFoxFN 已提交
509
/* 24 */
D
dolymood 已提交
510 511
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
512
var isObject = __webpack_require__(5);
D
dolymood 已提交
513 514 515 516 517 518 519 520
var document = __webpack_require__(0).document;
// typeof document.createElement is 'object' in old IE
var is = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
  return is ? document.createElement(it) : {};
};


D
dolymood 已提交
521
/***/ }),
A
AmyFoxFN 已提交
522
/* 25 */
D
dolymood 已提交
523 524
/***/ (function(module, exports, __webpack_require__) {

D
dolymood 已提交
525 526 527 528 529 530 531 532
var global = __webpack_require__(0);
var SHARED = '__core-js_shared__';
var store = global[SHARED] || (global[SHARED] = {});
module.exports = function (key) {
  return store[key] || (store[key] = {});
};


A
AmyFoxFN 已提交
533
/***/ }),
A
AmyFoxFN 已提交
534
/* 26 */
A
AmyFoxFN 已提交
535 536 537 538 539 540 541 542
/***/ (function(module, exports) {

// IE 8- don't enum bug keys
module.exports = (
  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
).split(',');


D
dolymood 已提交
543
/***/ }),
D
dolymood 已提交
544
/* 27 */
A
AmyFoxFN 已提交
545
/***/ (function(module, exports, __webpack_require__) {
D
dolymood 已提交
546

A
AmyFoxFN 已提交
547
// 7.1.15 ToLength
A
AmyFoxFN 已提交
548
var toInteger = __webpack_require__(14);
A
AmyFoxFN 已提交
549 550 551 552
var min = Math.min;
module.exports = function (it) {
  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
};
D
dolymood 已提交
553 554 555


/***/ }),
A
AmyFoxFN 已提交
556 557
/* 28 */
/***/ (function(module, exports) {
D
dolymood 已提交
558

A
AmyFoxFN 已提交
559 560 561 562
module.exports = function (it) {
  if (typeof it != 'function') throw TypeError(it + ' is not a function!');
  return it;
};
D
dolymood 已提交
563 564 565


/***/ }),
A
AmyFoxFN 已提交
566
/* 29 */
D
dolymood 已提交
567 568
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
569 570 571 572 573 574
module.exports = { "default": __webpack_require__(42), __esModule: true };

/***/ }),
/* 30 */
/***/ (function(module, exports, __webpack_require__) {

D
dolymood 已提交
575
// 7.1.1 ToPrimitive(input [, PreferredType])
A
AmyFoxFN 已提交
576
var isObject = __webpack_require__(5);
D
dolymood 已提交
577 578 579 580 581 582 583 584 585 586 587 588 589
// instead of the ES6 spec version, we didn't implement @@toPrimitive case
// and the second argument - flag - preferred type is a string
module.exports = function (it, S) {
  if (!isObject(it)) return it;
  var fn, val;
  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
  throw TypeError("Can't convert object to primitive value");
};


/***/ }),
A
AmyFoxFN 已提交
590 591 592 593 594 595 596 597 598
/* 31 */
/***/ (function(module, exports) {

exports.f = {}.propertyIsEnumerable;


/***/ }),
/* 32 */,
/* 33 */
A
AmyFoxFN 已提交
599 600
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
601 602
module.exports = !__webpack_require__(4) && !__webpack_require__(9)(function () {
  return Object.defineProperty(__webpack_require__(24)('div'), 'a', { get: function () { return 7; } }).a != 7;
A
AmyFoxFN 已提交
603 604 605 606
});


/***/ }),
A
AmyFoxFN 已提交
607
/* 34 */
D
dolymood 已提交
608 609
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
610
var has = __webpack_require__(10);
A
AmyFoxFN 已提交
611 612
var toIObject = __webpack_require__(12);
var arrayIndexOf = __webpack_require__(37)(false);
D
dolymood 已提交
613
var IE_PROTO = __webpack_require__(16)('IE_PROTO');
D
dolymood 已提交
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628

module.exports = function (object, names) {
  var O = toIObject(object);
  var i = 0;
  var result = [];
  var key;
  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
  // Don't enum bug & hidden keys
  while (names.length > i) if (has(O, key = names[i++])) {
    ~arrayIndexOf(result, key) || result.push(key);
  }
  return result;
};


A
AmyFoxFN 已提交
629
/***/ }),
A
AmyFoxFN 已提交
630 631 632 633 634 635 636 637 638 639 640 641 642 643
/* 35 */
/***/ (function(module, exports, __webpack_require__) {

var def = __webpack_require__(7).f;
var has = __webpack_require__(10);
var TAG = __webpack_require__(2)('toStringTag');

module.exports = function (it, tag, stat) {
  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
};


/***/ }),
/* 36 */
A
AmyFoxFN 已提交
644 645
/***/ (function(module, exports) {

A
AmyFoxFN 已提交
646
exports.f = Object.getOwnPropertySymbols;
A
AmyFoxFN 已提交
647 648


D
dolymood 已提交
649
/***/ }),
A
AmyFoxFN 已提交
650
/* 37 */
D
dolymood 已提交
651 652 653 654
/***/ (function(module, exports, __webpack_require__) {

// false -> Array#indexOf
// true  -> Array#includes
A
AmyFoxFN 已提交
655
var toIObject = __webpack_require__(12);
A
AmyFoxFN 已提交
656
var toLength = __webpack_require__(27);
A
AmyFoxFN 已提交
657
var toAbsoluteIndex = __webpack_require__(38);
D
dolymood 已提交
658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678
module.exports = function (IS_INCLUDES) {
  return function ($this, el, fromIndex) {
    var O = toIObject($this);
    var length = toLength(O.length);
    var index = toAbsoluteIndex(fromIndex, length);
    var value;
    // Array#includes uses SameValueZero equality algorithm
    // eslint-disable-next-line no-self-compare
    if (IS_INCLUDES && el != el) while (length > index) {
      value = O[index++];
      // eslint-disable-next-line no-self-compare
      if (value != value) return true;
    // Array#indexOf ignores holes, Array#includes - not
    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
      if (O[index] === el) return IS_INCLUDES || index || 0;
    } return !IS_INCLUDES && -1;
  };
};


/***/ }),
A
AmyFoxFN 已提交
679
/* 38 */
D
dolymood 已提交
680 681
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
682
var toInteger = __webpack_require__(14);
D
dolymood 已提交
683 684 685 686 687 688 689 690
var max = Math.max;
var min = Math.min;
module.exports = function (index, length) {
  index = toInteger(index);
  return index < 0 ? max(index + length, 0) : min(index, length);
};


D
dolymood 已提交
691
/***/ }),
A
AmyFoxFN 已提交
692 693 694
/* 39 */,
/* 40 */,
/* 41 */
D
dolymood 已提交
695 696
/***/ (function(module, exports) {

A
AmyFoxFN 已提交
697
module.exports = true;
A
AmyFoxFN 已提交
698 699 700


/***/ }),
A
AmyFoxFN 已提交
701
/* 42 */
D
dolymood 已提交
702 703
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
704
__webpack_require__(43);
D
dolymood 已提交
705
module.exports = __webpack_require__(3).Object.assign;
D
dolymood 已提交
706 707 708


/***/ }),
A
AmyFoxFN 已提交
709
/* 43 */
D
dolymood 已提交
710 711 712
/***/ (function(module, exports, __webpack_require__) {

// 19.1.3.1 Object.assign(target, source)
A
AmyFoxFN 已提交
713
var $export = __webpack_require__(11);
D
dolymood 已提交
714

A
AmyFoxFN 已提交
715
$export($export.S + $export.F, 'Object', { assign: __webpack_require__(44) });
D
dolymood 已提交
716 717 718


/***/ }),
A
AmyFoxFN 已提交
719
/* 44 */
D
dolymood 已提交
720 721 722 723 724
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 19.1.2.1 Object.assign(target, source, ...)
A
AmyFoxFN 已提交
725 726 727 728 729
var getKeys = __webpack_require__(18);
var gOPS = __webpack_require__(36);
var pIE = __webpack_require__(31);
var toObject = __webpack_require__(17);
var IObject = __webpack_require__(23);
D
dolymood 已提交
730 731 732
var $assign = Object.assign;

// should work with symbols and should have deterministic property order (V8 bug)
A
AmyFoxFN 已提交
733
module.exports = !$assign || __webpack_require__(9)(function () {
D
dolymood 已提交
734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759
  var A = {};
  var B = {};
  // eslint-disable-next-line no-undef
  var S = Symbol();
  var K = 'abcdefghijklmnopqrst';
  A[S] = 7;
  K.split('').forEach(function (k) { B[k] = k; });
  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
  var T = toObject(target);
  var aLen = arguments.length;
  var index = 1;
  var getSymbols = gOPS.f;
  var isEnum = pIE.f;
  while (aLen > index) {
    var S = IObject(arguments[index++]);
    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
    var length = keys.length;
    var j = 0;
    var key;
    while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
  } return T;
} : $assign;


/***/ }),
A
AmyFoxFN 已提交
760
/* 45 */
A
AmyFoxFN 已提交
761
/***/ (function(module, exports, __webpack_require__) {
D
dolymood 已提交
762

A
AmyFoxFN 已提交
763
"use strict";
D
dolymood 已提交
764

A
AmyFoxFN 已提交
765 766 767 768
var LIBRARY = __webpack_require__(41);
var $export = __webpack_require__(11);
var redefine = __webpack_require__(47);
var hide = __webpack_require__(6);
A
AmyFoxFN 已提交
769
var has = __webpack_require__(10);
A
AmyFoxFN 已提交
770 771 772 773 774
var Iterators = __webpack_require__(22);
var $iterCreate = __webpack_require__(56);
var setToStringTag = __webpack_require__(35);
var getPrototypeOf = __webpack_require__(58);
var ITERATOR = __webpack_require__(2)('iterator');
A
AmyFoxFN 已提交
775 776 777 778
var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
var FF_ITERATOR = '@@iterator';
var KEYS = 'keys';
var VALUES = 'values';
D
dolymood 已提交
779

A
AmyFoxFN 已提交
780
var returnThis = function () { return this; };
D
dolymood 已提交
781

A
AmyFoxFN 已提交
782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
  $iterCreate(Constructor, NAME, next);
  var getMethod = function (kind) {
    if (!BUGGY && kind in proto) return proto[kind];
    switch (kind) {
      case KEYS: return function keys() { return new Constructor(this, kind); };
      case VALUES: return function values() { return new Constructor(this, kind); };
    } return function entries() { return new Constructor(this, kind); };
  };
  var TAG = NAME + ' Iterator';
  var DEF_VALUES = DEFAULT == VALUES;
  var VALUES_BUG = false;
  var proto = Base.prototype;
  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
  var $default = (!BUGGY && $native) || getMethod(DEFAULT);
  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
  var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
  var methods, key, IteratorPrototype;
  // Fix native
  if ($anyNative) {
    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
      // Set @@toStringTag to native iterators
      setToStringTag(IteratorPrototype, TAG, true);
      // fix for some old engines
      if (!LIBRARY && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis);
    }
  }
  // fix Array#{values, @@iterator}.name in V8 / FF
  if (DEF_VALUES && $native && $native.name !== VALUES) {
    VALUES_BUG = true;
    $default = function values() { return $native.call(this); };
  }
  // Define iterator
  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
    hide(proto, ITERATOR, $default);
  }
  // Plug for library
  Iterators[NAME] = $default;
  Iterators[TAG] = returnThis;
  if (DEFAULT) {
    methods = {
      values: DEF_VALUES ? $default : getMethod(VALUES),
      keys: IS_SET ? $default : getMethod(KEYS),
      entries: $entries
    };
    if (FORCED) for (key in methods) {
      if (!(key in proto)) redefine(proto, key, methods[key]);
    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
  }
  return methods;
D
dolymood 已提交
833 834 835 836
};


/***/ }),
A
AmyFoxFN 已提交
837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925
/* 46 */,
/* 47 */
/***/ (function(module, exports, __webpack_require__) {

module.exports = __webpack_require__(6);


/***/ }),
/* 48 */
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
var anObject = __webpack_require__(8);
var dPs = __webpack_require__(57);
var enumBugKeys = __webpack_require__(26);
var IE_PROTO = __webpack_require__(16)('IE_PROTO');
var Empty = function () { /* empty */ };
var PROTOTYPE = 'prototype';

// Create object with fake `null` prototype: use iframe Object with cleared prototype
var createDict = function () {
  // Thrash, waste and sodomy: IE GC bug
  var iframe = __webpack_require__(24)('iframe');
  var i = enumBugKeys.length;
  var lt = '<';
  var gt = '>';
  var iframeDocument;
  iframe.style.display = 'none';
  __webpack_require__(49).appendChild(iframe);
  iframe.src = 'javascript:'; // eslint-disable-line no-script-url
  // createDict = iframe.contentWindow.Object;
  // html.removeChild(iframe);
  iframeDocument = iframe.contentWindow.document;
  iframeDocument.open();
  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
  iframeDocument.close();
  createDict = iframeDocument.F;
  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
  return createDict();
};

module.exports = Object.create || function create(O, Properties) {
  var result;
  if (O !== null) {
    Empty[PROTOTYPE] = anObject(O);
    result = new Empty();
    Empty[PROTOTYPE] = null;
    // add "__proto__" for Object.getPrototypeOf polyfill
    result[IE_PROTO] = O;
  } else result = createDict();
  return Properties === undefined ? result : dPs(result, Properties);
};


/***/ }),
/* 49 */
/***/ (function(module, exports, __webpack_require__) {

var document = __webpack_require__(0).document;
module.exports = document && document.documentElement;


/***/ }),
/* 50 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var $at = __webpack_require__(55)(true);

// 21.1.3.27 String.prototype[@@iterator]()
__webpack_require__(45)(String, 'String', function (iterated) {
  this._t = String(iterated); // target
  this._i = 0;                // next index
// 21.1.5.2.1 %StringIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var index = this._i;
  var point;
  if (index >= O.length) return { value: undefined, done: true };
  point = $at(O, index);
  this._i += point.length;
  return { value: point, done: false };
});


/***/ }),
/* 51 */,
/* 52 */,
A
AmyFoxFN 已提交
926 927
/* 53 */,
/* 54 */
D
dolymood 已提交
928
/***/ (function(module, __webpack_exports__, __webpack_require__) {
D
dolymood 已提交
929

D
dolymood 已提交
930 931
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
D
dolymood 已提交
932
/*!
A
AmyFoxFN 已提交
933
 * better-normal-scroll v1.9.1
A
update  
AmyFoxFN 已提交
934
 * (c) 2016-2018 ustbhuangyi
D
dolymood 已提交
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013
 * Released under the MIT License.
 */
var slicedToArray = function () {
  function sliceIterator(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;

    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);

        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"]) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }

    return _arr;
  }

  return function (arr, i) {
    if (Array.isArray(arr)) {
      return arr;
    } else if (Symbol.iterator in Object(arr)) {
      return sliceIterator(arr, i);
    } else {
      throw new TypeError("Invalid attempt to destructure non-iterable instance");
    }
  };
}();













var toConsumableArray = function (arr) {
  if (Array.isArray(arr)) {
    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

    return arr2;
  } else {
    return Array.from(arr);
  }
};

function eventMixin(BScroll) {
  BScroll.prototype.on = function (type, fn) {
    var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;

    if (!this._events[type]) {
      this._events[type] = [];
    }

    this._events[type].push([fn, context]);
  };

  BScroll.prototype.once = function (type, fn) {
    var context = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this;

    function magic() {
      this.off(type, magic);

D
dolymood 已提交
1014
      fn.apply(context, arguments);
D
dolymood 已提交
1015
    }
D
dolymood 已提交
1016
    // To expose the corresponding function method in order to execute the off method
D
dolymood 已提交
1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057
    magic.fn = fn;

    this.on(type, magic);
  };

  BScroll.prototype.off = function (type, fn) {
    var _events = this._events[type];
    if (!_events) {
      return;
    }

    var count = _events.length;
    while (count--) {
      if (_events[count][0] === fn || _events[count][0] && _events[count][0].fn === fn) {
        _events[count][0] = undefined;
      }
    }
  };

  BScroll.prototype.trigger = function (type) {
    var events = this._events[type];
    if (!events) {
      return;
    }

    var len = events.length;
    var eventsCopy = [].concat(toConsumableArray(events));
    for (var i = 0; i < len; i++) {
      var event = eventsCopy[i];

      var _event = slicedToArray(event, 2),
          fn = _event[0],
          context = _event[1];

      if (fn) {
        fn.apply(context, [].slice.call(arguments, 1));
      }
    }
  };
}

A
AmyFoxFN 已提交
1058 1059 1060 1061 1062
// ssr support
var inBrowser = typeof window !== 'undefined';
var ua = inBrowser && navigator.userAgent.toLowerCase();
var isWeChatDevTools = ua && /wechatdevtools/.test(ua);
var isAndroid = ua && ua.indexOf('android') > 0;
D
dolymood 已提交
1063

D
dolymood 已提交
1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081
function getNow() {
  return window.performance && window.performance.now ? window.performance.now() + window.performance.timing.navigationStart : +new Date();
}

function extend(target) {
  for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    rest[_key - 1] = arguments[_key];
  }

  for (var i = 0; i < rest.length; i++) {
    var source = rest[i];
    for (var key in source) {
      target[key] = source[key];
    }
  }
  return target;
}

A
AmyFoxFN 已提交
1082 1083 1084 1085 1086
function isUndef(v) {
  return v === undefined || v === null;
}

var elementStyle = inBrowser && document.createElement('div').style;
D
dolymood 已提交
1087 1088

var vendor = function () {
A
AmyFoxFN 已提交
1089 1090 1091
  if (!inBrowser) {
    return false;
  }
D
dolymood 已提交
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
  var transformNames = {
    webkit: 'webkitTransform',
    Moz: 'MozTransform',
    O: 'OTransform',
    ms: 'msTransform',
    standard: 'transform'
  };

  for (var key in transformNames) {
    if (elementStyle[transformNames[key]] !== undefined) {
      return key;
    }
  }

  return false;
}();

function prefixStyle(style) {
  if (vendor === false) {
    return false;
  }

  if (vendor === 'standard') {
D
dolymood 已提交
1115 1116 1117
    if (style === 'transitionEnd') {
      return 'transitionend';
    }
D
dolymood 已提交
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149
    return style;
  }

  return vendor + style.charAt(0).toUpperCase() + style.substr(1);
}

function addEvent(el, type, fn, capture) {
  el.addEventListener(type, fn, { passive: false, capture: !!capture });
}

function removeEvent(el, type, fn, capture) {
  el.removeEventListener(type, fn, { passive: false, capture: !!capture });
}

function offset(el) {
  var left = 0;
  var top = 0;

  while (el) {
    left -= el.offsetLeft;
    top -= el.offsetTop;
    el = el.offsetParent;
  }

  return {
    left: left,
    top: top
  };
}

var transform = prefixStyle('transform');

A
AmyFoxFN 已提交
1150
var hasPerspective = inBrowser && prefixStyle('perspective') in elementStyle;
D
dolymood 已提交
1151
// fix issue #361
A
AmyFoxFN 已提交
1152
var hasTouch = inBrowser && ('ontouchstart' in window || isWeChatDevTools);
D
dolymood 已提交
1153
var hasTransform = transform !== false;
A
AmyFoxFN 已提交
1154
var hasTransition = inBrowser && prefixStyle('transition') in elementStyle;
D
dolymood 已提交
1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215

var style = {
  transform: transform,
  transitionTimingFunction: prefixStyle('transitionTimingFunction'),
  transitionDuration: prefixStyle('transitionDuration'),
  transitionProperty: prefixStyle('transitionProperty'),
  transitionDelay: prefixStyle('transitionDelay'),
  transformOrigin: prefixStyle('transformOrigin'),
  transitionEnd: prefixStyle('transitionEnd')
};

var TOUCH_EVENT = 1;
var MOUSE_EVENT = 2;

var eventType = {
  touchstart: TOUCH_EVENT,
  touchmove: TOUCH_EVENT,
  touchend: TOUCH_EVENT,

  mousedown: MOUSE_EVENT,
  mousemove: MOUSE_EVENT,
  mouseup: MOUSE_EVENT
};

function getRect(el) {
  if (el instanceof window.SVGElement) {
    var rect = el.getBoundingClientRect();
    return {
      top: rect.top,
      left: rect.left,
      width: rect.width,
      height: rect.height
    };
  } else {
    return {
      top: el.offsetTop,
      left: el.offsetLeft,
      width: el.offsetWidth,
      height: el.offsetHeight
    };
  }
}

function preventDefaultException(el, exceptions) {
  for (var i in exceptions) {
    if (exceptions[i].test(el[i])) {
      return true;
    }
  }
  return false;
}

function tap(e, eventName) {
  var ev = document.createEvent('Event');
  ev.initEvent(eventName, true, true);
  ev.pageX = e.pageX;
  ev.pageY = e.pageY;
  e.target.dispatchEvent(ev);
}

function click(e) {
A
update  
AmyFoxFN 已提交
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231
  var eventSource = void 0;
  if (e.type === 'mouseup' || e.type === 'mousecancel') {
    eventSource = e;
  } else if (e.type === 'touchend' || e.type === 'touchcancel') {
    eventSource = e.changedTouches[0];
  }
  var posSrc = {};
  if (eventSource) {
    posSrc.screenX = eventSource.screenX || 0;
    posSrc.screenY = eventSource.screenY || 0;
    posSrc.clientX = eventSource.clientX || 0;
    posSrc.clientY = eventSource.clientY || 0;
  }
  var ev = void 0;
  var event = 'click';
  var bubbles = true;
D
dolymood 已提交
1232
  var cancelable = true;
A
update  
AmyFoxFN 已提交
1233
  if (typeof MouseEvent !== 'undefined') {
D
dolymood 已提交
1234 1235 1236 1237 1238 1239 1240 1241
    try {
      ev = new MouseEvent(event, extend({
        bubbles: bubbles,
        cancelable: cancelable
      }, posSrc));
    } catch (e) {
      createEvent();
    }
A
update  
AmyFoxFN 已提交
1242
  } else {
D
dolymood 已提交
1243 1244 1245 1246
    createEvent();
  }

  function createEvent() {
A
update  
AmyFoxFN 已提交
1247 1248 1249
    ev = document.createEvent('Event');
    ev.initEvent(event, bubbles, cancelable);
    extend(ev, posSrc);
A
AmyFoxFN 已提交
1250
  }
D
dolymood 已提交
1251 1252 1253

  // forwardedTouchEvent set to true in case of the conflict with fastclick
  ev.forwardedTouchEvent = true;
A
update  
AmyFoxFN 已提交
1254 1255
  ev._constructed = true;
  e.target.dispatchEvent(ev);
D
dolymood 已提交
1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269
}

function prepend(el, target) {
  if (target.firstChild) {
    before(el, target.firstChild);
  } else {
    target.appendChild(el);
  }
}

function before(el, target) {
  target.parentNode.insertBefore(el, target);
}

D
dolymood 已提交
1270 1271 1272 1273
function removeChild(el, child) {
  el.removeChild(child);
}

D
dolymood 已提交
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
var DEFAULT_OPTIONS = {
  startX: 0,
  startY: 0,
  scrollX: false,
  scrollY: true,
  freeScroll: false,
  directionLockThreshold: 5,
  eventPassthrough: '',
  click: false,
  tap: false,
  bounce: true,
D
dolymood 已提交
1285
  bounceTime: 800,
D
dolymood 已提交
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
  momentum: true,
  momentumLimitTime: 300,
  momentumLimitDistance: 15,
  swipeTime: 2500,
  swipeBounceTime: 500,
  deceleration: 0.001,
  flickLimitTime: 200,
  flickLimitDistance: 100,
  resizePolling: 60,
  probeType: 0,
  preventDefault: true,
  preventDefaultException: {
    tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/
  },
  HWCompositing: true,
  useTransition: true,
  useTransform: true,
  bindToWrapper: false,
  disableMouse: hasTouch,
  disableTouch: !hasTouch,
D
dolymood 已提交
1306
  observeDOM: true,
A
update  
AmyFoxFN 已提交
1307
  autoBlur: true,
D
dolymood 已提交
1308 1309 1310 1311 1312 1313
  /**
   * for picker
   * wheel: {
   *   selectedIndex: 0,
   *   rotate: 25,
   *   adjustTime: 400
D
dolymood 已提交
1314 1315
   *   wheelWrapperClass: 'wheel-scroll',
   *   wheelItemClass: 'wheel-item'
D
dolymood 已提交
1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326
   * }
   */
  wheel: false,
  /**
   * for slide
   * snap: {
   *   loop: false,
   *   el: domEl,
   *   threshold: 0.1,
   *   stepX: 100,
   *   stepY: 100,
A
update  
AmyFoxFN 已提交
1327 1328 1329 1330 1331 1332 1333
   *   speed: 400,
   *   easing: {
   *     style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
   *     fn: function (t) {
   *       return t * (2 - t)
   *     }
   *   }
D
dolymood 已提交
1334 1335 1336 1337 1338 1339 1340
   *   listenFlick: true
   * }
   */
  snap: false,
  /**
   * for scrollbar
   * scrollbar: {
A
update  
AmyFoxFN 已提交
1341 1342
   *   fade: true,
   *   interactive: false
D
dolymood 已提交
1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359
   * }
   */
  scrollbar: false,
  /**
   * for pull down and refresh
   * pullDownRefresh: {
   *   threshold: 50,
   *   stop: 20
   * }
   */
  pullDownRefresh: false,
  /**
   * for pull up and load
   * pullUpLoad: {
   *   threshold: 50
   * }
   */
A
update  
AmyFoxFN 已提交
1360 1361 1362 1363 1364 1365 1366 1367
  pullUpLoad: false,
  /**
   * for mouse wheel
   * mouseWheel:{
   *   speed: 20,
   *   invert: false
   * }
   */
A
AmyFoxFN 已提交
1368 1369
  mouseWheel: false,
  stopPropagation: false
D
dolymood 已提交
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389
};

function initMixin(BScroll) {
  BScroll.prototype._init = function (el, options) {
    this._handleOptions(options);

    // init private custom events
    this._events = {};

    this.x = 0;
    this.y = 0;
    this.directionX = 0;
    this.directionY = 0;

    this._addDOMEvents();

    this._initExtFeatures();

    this._watchTransition();

D
dolymood 已提交
1390 1391 1392 1393
    if (this.options.observeDOM) {
      this._initDOMObserver();
    }

A
update  
AmyFoxFN 已提交
1394 1395 1396 1397
    if (this.options.autoBlur) {
      this._handleAutoBlur();
    }

D
dolymood 已提交
1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478
    this.refresh();

    if (!this.options.snap) {
      this.scrollTo(this.options.startX, this.options.startY);
    }

    this.enable();
  };

  BScroll.prototype._handleOptions = function (options) {
    this.options = extend({}, DEFAULT_OPTIONS, options);

    this.translateZ = this.options.HWCompositing && hasPerspective ? ' translateZ(0)' : '';

    this.options.useTransition = this.options.useTransition && hasTransition;
    this.options.useTransform = this.options.useTransform && hasTransform;

    this.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;

    // If you want eventPassthrough I have to lock one of the axes
    this.options.scrollX = this.options.eventPassthrough === 'horizontal' ? false : this.options.scrollX;
    this.options.scrollY = this.options.eventPassthrough === 'vertical' ? false : this.options.scrollY;

    // With eventPassthrough we also need lockDirection mechanism
    this.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;
    this.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;

    if (this.options.tap === true) {
      this.options.tap = 'tap';
    }
  };

  BScroll.prototype._addDOMEvents = function () {
    var eventOperation = addEvent;
    this._handleDOMEvents(eventOperation);
  };

  BScroll.prototype._removeDOMEvents = function () {
    var eventOperation = removeEvent;
    this._handleDOMEvents(eventOperation);
  };

  BScroll.prototype._handleDOMEvents = function (eventOperation) {
    var target = this.options.bindToWrapper ? this.wrapper : window;
    eventOperation(window, 'orientationchange', this);
    eventOperation(window, 'resize', this);

    if (this.options.click) {
      eventOperation(this.wrapper, 'click', this, true);
    }

    if (!this.options.disableMouse) {
      eventOperation(this.wrapper, 'mousedown', this);
      eventOperation(target, 'mousemove', this);
      eventOperation(target, 'mousecancel', this);
      eventOperation(target, 'mouseup', this);
    }

    if (hasTouch && !this.options.disableTouch) {
      eventOperation(this.wrapper, 'touchstart', this);
      eventOperation(target, 'touchmove', this);
      eventOperation(target, 'touchcancel', this);
      eventOperation(target, 'touchend', this);
    }

    eventOperation(this.scroller, style.transitionEnd, this);
  };

  BScroll.prototype._initExtFeatures = function () {
    if (this.options.snap) {
      this._initSnap();
    }
    if (this.options.scrollbar) {
      this._initScrollbar();
    }
    if (this.options.pullUpLoad) {
      this._initPullUp();
    }
    if (this.options.pullDownRefresh) {
      this._initPullDown();
    }
D
dolymood 已提交
1479 1480 1481
    if (this.options.wheel) {
      this._initWheel();
    }
A
update  
AmyFoxFN 已提交
1482 1483 1484
    if (this.options.mouseWheel) {
      this._initMouseWheel();
    }
D
dolymood 已提交
1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500
  };

  BScroll.prototype._watchTransition = function () {
    if (typeof Object.defineProperty !== 'function') {
      return;
    }
    var me = this;
    var isInTransition = false;
    Object.defineProperty(this, 'isInTransition', {
      get: function get() {
        return isInTransition;
      },
      set: function set(newVal) {
        isInTransition = newVal;
        // fix issue #359
        var el = me.scroller.children.length ? me.scroller.children : [me.scroller];
D
dolymood 已提交
1501
        var pointerEvents = isInTransition && !me.pulling ? 'none' : 'auto';
D
dolymood 已提交
1502 1503 1504 1505 1506 1507 1508
        for (var i = 0; i < el.length; i++) {
          el[i].style.pointerEvents = pointerEvents;
        }
      }
    });
  };

A
update  
AmyFoxFN 已提交
1509 1510 1511 1512 1513 1514 1515 1516 1517
  BScroll.prototype._handleAutoBlur = function () {
    this.on('beforeScrollStart', function () {
      var activeElement = document.activeElement;
      if (activeElement && (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA')) {
        activeElement.blur();
      }
    });
  };

D
dolymood 已提交
1518 1519 1520 1521 1522 1523
  BScroll.prototype._initDOMObserver = function () {
    var _this = this;

    if (typeof MutationObserver !== 'undefined') {
      var timer = void 0;
      var observer = new MutationObserver(function (mutations) {
D
dolymood 已提交
1524 1525
        // don't do any refresh during the transition, or outside of the boundaries
        if (_this._shouldNotRefresh()) {
D
dolymood 已提交
1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547
          return;
        }
        var immediateRefresh = false;
        var deferredRefresh = false;
        for (var i = 0; i < mutations.length; i++) {
          var mutation = mutations[i];
          if (mutation.type !== 'attributes') {
            immediateRefresh = true;
            break;
          } else {
            if (mutation.target !== _this.scroller) {
              deferredRefresh = true;
              break;
            }
          }
        }
        if (immediateRefresh) {
          _this.refresh();
        } else if (deferredRefresh) {
          // attributes changes too often
          clearTimeout(timer);
          timer = setTimeout(function () {
D
dolymood 已提交
1548 1549 1550
            if (!_this._shouldNotRefresh()) {
              _this.refresh();
            }
D
dolymood 已提交
1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568
          }, 60);
        }
      });
      var config = {
        attributes: true,
        childList: true,
        subtree: true
      };
      observer.observe(this.scroller, config);

      this.on('destroy', function () {
        observer.disconnect();
      });
    } else {
      this._checkDOMUpdate();
    }
  };

D
dolymood 已提交
1569 1570 1571 1572 1573 1574
  BScroll.prototype._shouldNotRefresh = function () {
    var outsideBoundaries = this.x > 0 || this.x < this.maxScrollX || this.y > 0 || this.y < this.maxScrollY;

    return this.isInTransition || this.stopFromTransition || outsideBoundaries;
  };

D
dolymood 已提交
1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605
  BScroll.prototype._checkDOMUpdate = function () {
    var scrollerRect = getRect(this.scroller);
    var oldWidth = scrollerRect.width;
    var oldHeight = scrollerRect.height;

    function check() {
      if (this.destroyed) {
        return;
      }
      scrollerRect = getRect(this.scroller);
      var newWidth = scrollerRect.width;
      var newHeight = scrollerRect.height;

      if (oldWidth !== newWidth || oldHeight !== newHeight) {
        this.refresh();
      }
      oldWidth = newWidth;
      oldHeight = newHeight;

      next.call(this);
    }

    function next() {
      var _this2 = this;

      setTimeout(function () {
        check.call(_this2);
      }, 1000);
    }

    next.call(this);
D
dolymood 已提交
1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637
  };

  BScroll.prototype.handleEvent = function (e) {
    switch (e.type) {
      case 'touchstart':
      case 'mousedown':
        this._start(e);
        break;
      case 'touchmove':
      case 'mousemove':
        this._move(e);
        break;
      case 'touchend':
      case 'mouseup':
      case 'touchcancel':
      case 'mousecancel':
        this._end(e);
        break;
      case 'orientationchange':
      case 'resize':
        this._resize();
        break;
      case 'transitionend':
      case 'webkitTransitionEnd':
      case 'oTransitionEnd':
      case 'MSTransitionEnd':
        this._transitionEnd(e);
        break;
      case 'click':
        if (this.enabled && !e._constructed) {
          if (!preventDefaultException(e.target, this.options.preventDefaultException)) {
            e.preventDefault();
D
dolymood 已提交
1638
            e.stopPropagation();
D
dolymood 已提交
1639 1640 1641
          }
        }
        break;
A
update  
AmyFoxFN 已提交
1642 1643 1644 1645 1646
      case 'wheel':
      case 'DOMMouseScroll':
      case 'mousewheel':
        this._onMouseWheel(e);
        break;
D
dolymood 已提交
1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663
    }
  };

  BScroll.prototype.refresh = function () {
    var wrapperRect = getRect(this.wrapper);
    this.wrapperWidth = wrapperRect.width;
    this.wrapperHeight = wrapperRect.height;

    var scrollerRect = getRect(this.scroller);
    this.scrollerWidth = scrollerRect.width;
    this.scrollerHeight = scrollerRect.height;

    var wheel = this.options.wheel;
    if (wheel) {
      this.items = this.scroller.children;
      this.options.itemHeight = this.itemHeight = this.items.length ? this.scrollerHeight / this.items.length : 0;
      if (this.selectedIndex === undefined) {
D
dolymood 已提交
1664
        this.selectedIndex = wheel.selectedIndex || 0;
D
dolymood 已提交
1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749
      }
      this.options.startY = -this.selectedIndex * this.itemHeight;
      this.maxScrollX = 0;
      this.maxScrollY = -this.itemHeight * (this.items.length - 1);
    } else {
      this.maxScrollX = this.wrapperWidth - this.scrollerWidth;
      this.maxScrollY = this.wrapperHeight - this.scrollerHeight;
    }

    this.hasHorizontalScroll = this.options.scrollX && this.maxScrollX < 0;
    this.hasVerticalScroll = this.options.scrollY && this.maxScrollY < 0;

    if (!this.hasHorizontalScroll) {
      this.maxScrollX = 0;
      this.scrollerWidth = this.wrapperWidth;
    }

    if (!this.hasVerticalScroll) {
      this.maxScrollY = 0;
      this.scrollerHeight = this.wrapperHeight;
    }

    this.endTime = 0;
    this.directionX = 0;
    this.directionY = 0;
    this.wrapperOffset = offset(this.wrapper);

    this.trigger('refresh');

    this.resetPosition();
  };

  BScroll.prototype.enable = function () {
    this.enabled = true;
  };

  BScroll.prototype.disable = function () {
    this.enabled = false;
  };
}

var ease = {
	// easeOutQuint
	swipe: {
		style: 'cubic-bezier(0.23, 1, 0.32, 1)',
		fn: function fn(t) {
			return 1 + --t * t * t * t * t;
		}
	},
	// easeOutQuard
	swipeBounce: {
		style: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',
		fn: function fn(t) {
			return t * (2 - t);
		}
	},
	// easeOutQuart
	bounce: {
		style: 'cubic-bezier(0.165, 0.84, 0.44, 1)',
		fn: function fn(t) {
			return 1 - --t * t * t * t;
		}
	}
};

function momentum(current, start, time, lowerMargin, wrapperSize, options) {
  var distance = current - start;
  var speed = Math.abs(distance) / time;

  var deceleration = options.deceleration,
      itemHeight = options.itemHeight,
      swipeBounceTime = options.swipeBounceTime,
      wheel = options.wheel,
      swipeTime = options.swipeTime;

  var duration = swipeTime;
  var rate = wheel ? 4 : 15;

  var destination = current + speed / deceleration * (distance < 0 ? -1 : 1);

  if (wheel && itemHeight) {
    destination = Math.round(destination / itemHeight) * itemHeight;
  }

  if (destination < lowerMargin) {
D
dolymood 已提交
1750
    destination = wrapperSize ? Math.max(lowerMargin - wrapperSize / 4, lowerMargin - wrapperSize / rate * speed) : lowerMargin;
D
dolymood 已提交
1751 1752
    duration = swipeBounceTime;
  } else if (destination > 0) {
D
dolymood 已提交
1753
    destination = wrapperSize ? Math.min(wrapperSize / 4, wrapperSize / rate * speed) : 0;
D
dolymood 已提交
1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764
    duration = swipeBounceTime;
  }

  return {
    destination: Math.round(destination),
    duration: duration
  };
}

var DEFAULT_INTERVAL = 100 / 60;

A
AmyFoxFN 已提交
1765 1766
function noop() {}

D
dolymood 已提交
1767
var requestAnimationFrame = function () {
A
AmyFoxFN 已提交
1768 1769 1770 1771
  if (!inBrowser) {
    /* istanbul ignore if */
    return noop;
  }
D
dolymood 已提交
1772 1773 1774 1775 1776 1777 1778 1779
  return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame ||
  // if all else fails, use setTimeout
  function (callback) {
    return window.setTimeout(callback, (callback.interval || DEFAULT_INTERVAL) / 2); // make interval as precise as possible.
  };
}();

var cancelAnimationFrame = function () {
A
AmyFoxFN 已提交
1780 1781 1782 1783
  if (!inBrowser) {
    /* istanbul ignore if */
    return noop;
  }
D
dolymood 已提交
1784 1785 1786 1787 1788
  return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || function (id) {
    window.clearTimeout(id);
  };
}();

D
dolymood 已提交
1789 1790 1791 1792 1793
var DIRECTION_UP = 1;
var DIRECTION_DOWN = -1;
var DIRECTION_LEFT = 1;
var DIRECTION_RIGHT = -1;

A
AmyFoxFN 已提交
1794 1795 1796 1797
var PROBE_DEBOUNCE = 1;

var PROBE_REALTIME = 3;

A
AmyFoxFN 已提交
1798 1799 1800 1801 1802 1803 1804 1805 1806 1807
function warn(msg) {
  console.error('[BScroll warn]: ' + msg);
}

function assert(condition, msg) {
  if (!condition) {
    throw new Error('[BScroll] ' + msg);
  }
}

D
dolymood 已提交
1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823
function coreMixin(BScroll) {
  BScroll.prototype._start = function (e) {
    var _eventType = eventType[e.type];
    if (_eventType !== TOUCH_EVENT) {
      if (e.button !== 0) {
        return;
      }
    }
    if (!this.enabled || this.destroyed || this.initiated && this.initiated !== _eventType) {
      return;
    }
    this.initiated = _eventType;

    if (this.options.preventDefault && !preventDefaultException(e.target, this.options.preventDefaultException)) {
      e.preventDefault();
    }
A
AmyFoxFN 已提交
1824 1825 1826
    if (this.options.stopPropagation) {
      e.stopPropagation();
    }
D
dolymood 已提交
1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865

    this.moved = false;
    this.distX = 0;
    this.distY = 0;
    this.directionX = 0;
    this.directionY = 0;
    this.movingDirectionX = 0;
    this.movingDirectionY = 0;
    this.directionLocked = 0;

    this._transitionTime();
    this.startTime = getNow();

    if (this.options.wheel) {
      this.target = e.target;
    }

    this.stop();

    var point = e.touches ? e.touches[0] : e;

    this.startX = this.x;
    this.startY = this.y;
    this.absStartX = this.x;
    this.absStartY = this.y;
    this.pointX = point.pageX;
    this.pointY = point.pageY;

    this.trigger('beforeScrollStart');
  };

  BScroll.prototype._move = function (e) {
    if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) {
      return;
    }

    if (this.options.preventDefault) {
      e.preventDefault();
    }
A
AmyFoxFN 已提交
1866 1867 1868
    if (this.options.stopPropagation) {
      e.stopPropagation();
    }
D
dolymood 已提交
1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920

    var point = e.touches ? e.touches[0] : e;
    var deltaX = point.pageX - this.pointX;
    var deltaY = point.pageY - this.pointY;

    this.pointX = point.pageX;
    this.pointY = point.pageY;

    this.distX += deltaX;
    this.distY += deltaY;

    var absDistX = Math.abs(this.distX);
    var absDistY = Math.abs(this.distY);

    var timestamp = getNow();

    // We need to move at least momentumLimitDistance pixels for the scrolling to initiate
    if (timestamp - this.endTime > this.options.momentumLimitTime && absDistY < this.options.momentumLimitDistance && absDistX < this.options.momentumLimitDistance) {
      return;
    }

    // If you are scrolling in one direction lock the other
    if (!this.directionLocked && !this.options.freeScroll) {
      if (absDistX > absDistY + this.options.directionLockThreshold) {
        this.directionLocked = 'h'; // lock horizontally
      } else if (absDistY >= absDistX + this.options.directionLockThreshold) {
        this.directionLocked = 'v'; // lock vertically
      } else {
        this.directionLocked = 'n'; // no lock
      }
    }

    if (this.directionLocked === 'h') {
      if (this.options.eventPassthrough === 'vertical') {
        e.preventDefault();
      } else if (this.options.eventPassthrough === 'horizontal') {
        this.initiated = false;
        return;
      }
      deltaY = 0;
    } else if (this.directionLocked === 'v') {
      if (this.options.eventPassthrough === 'horizontal') {
        e.preventDefault();
      } else if (this.options.eventPassthrough === 'vertical') {
        this.initiated = false;
        return;
      }
      deltaX = 0;
    }

    deltaX = this.hasHorizontalScroll ? deltaX : 0;
    deltaY = this.hasVerticalScroll ? deltaY : 0;
D
dolymood 已提交
1921 1922
    this.movingDirectionX = deltaX > 0 ? DIRECTION_RIGHT : deltaX < 0 ? DIRECTION_LEFT : 0;
    this.movingDirectionY = deltaY > 0 ? DIRECTION_DOWN : deltaY < 0 ? DIRECTION_UP : 0;
D
dolymood 已提交
1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954

    var newX = this.x + deltaX;
    var newY = this.y + deltaY;

    // Slow down or stop if outside of the boundaries
    if (newX > 0 || newX < this.maxScrollX) {
      if (this.options.bounce) {
        newX = this.x + deltaX / 3;
      } else {
        newX = newX > 0 ? 0 : this.maxScrollX;
      }
    }
    if (newY > 0 || newY < this.maxScrollY) {
      if (this.options.bounce) {
        newY = this.y + deltaY / 3;
      } else {
        newY = newY > 0 ? 0 : this.maxScrollY;
      }
    }

    if (!this.moved) {
      this.moved = true;
      this.trigger('scrollStart');
    }

    this._translate(newX, newY);

    if (timestamp - this.startTime > this.options.momentumLimitTime) {
      this.startTime = timestamp;
      this.startX = this.x;
      this.startY = this.y;

A
AmyFoxFN 已提交
1955
      if (this.options.probeType === PROBE_DEBOUNCE) {
D
dolymood 已提交
1956 1957 1958 1959 1960 1961 1962
        this.trigger('scroll', {
          x: this.x,
          y: this.y
        });
      }
    }

A
AmyFoxFN 已提交
1963
    if (this.options.probeType > PROBE_DEBOUNCE) {
D
dolymood 已提交
1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989
      this.trigger('scroll', {
        x: this.x,
        y: this.y
      });
    }

    var scrollLeft = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft;
    var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;

    var pX = this.pointX - scrollLeft;
    var pY = this.pointY - scrollTop;

    if (pX > document.documentElement.clientWidth - this.options.momentumLimitDistance || pX < this.options.momentumLimitDistance || pY < this.options.momentumLimitDistance || pY > document.documentElement.clientHeight - this.options.momentumLimitDistance) {
      this._end(e);
    }
  };

  BScroll.prototype._end = function (e) {
    if (!this.enabled || this.destroyed || eventType[e.type] !== this.initiated) {
      return;
    }
    this.initiated = false;

    if (this.options.preventDefault && !preventDefaultException(e.target, this.options.preventDefaultException)) {
      e.preventDefault();
    }
A
AmyFoxFN 已提交
1990 1991 1992
    if (this.options.stopPropagation) {
      e.stopPropagation();
    }
D
dolymood 已提交
1993 1994 1995 1996 1997 1998

    this.trigger('touchEnd', {
      x: this.x,
      y: this.y
    });

D
dolymood 已提交
1999
    this.isInTransition = false;
D
dolymood 已提交
2000

D
dolymood 已提交
2001 2002 2003 2004 2005 2006 2007 2008 2009
    // ensures that the last position is rounded
    var newX = Math.round(this.x);
    var newY = Math.round(this.y);

    var deltaX = newX - this.absStartX;
    var deltaY = newY - this.absStartY;
    this.directionX = deltaX > 0 ? DIRECTION_RIGHT : deltaX < 0 ? DIRECTION_LEFT : 0;
    this.directionY = deltaY > 0 ? DIRECTION_DOWN : deltaY < 0 ? DIRECTION_UP : 0;

D
dolymood 已提交
2010 2011 2012 2013 2014
    // if configure pull down refresh, check it first
    if (this.options.pullDownRefresh && this._checkPullDown()) {
      return;
    }

D
dolymood 已提交
2015 2016 2017 2018 2019 2020
    // check if it is a click operation
    if (this._checkClick(e)) {
      this.trigger('scrollCancel');
      return;
    }

D
dolymood 已提交
2021 2022 2023 2024
    // reset if we are outside of the boundaries
    if (this.resetPosition(this.options.bounceTime, ease.bounce)) {
      return;
    }
D
dolymood 已提交
2025

D
dolymood 已提交
2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064
    this.scrollTo(newX, newY);

    this.endTime = getNow();
    var duration = this.endTime - this.startTime;
    var absDistX = Math.abs(newX - this.startX);
    var absDistY = Math.abs(newY - this.startY);

    // flick
    if (this._events.flick && duration < this.options.flickLimitTime && absDistX < this.options.flickLimitDistance && absDistY < this.options.flickLimitDistance) {
      this.trigger('flick');
      return;
    }

    var time = 0;
    // start momentum animation if needed
    if (this.options.momentum && duration < this.options.momentumLimitTime && (absDistY > this.options.momentumLimitDistance || absDistX > this.options.momentumLimitDistance)) {
      var momentumX = this.hasHorizontalScroll ? momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options) : { destination: newX, duration: 0 };
      var momentumY = this.hasVerticalScroll ? momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options) : { destination: newY, duration: 0 };
      newX = momentumX.destination;
      newY = momentumY.destination;
      time = Math.max(momentumX.duration, momentumY.duration);
      this.isInTransition = true;
    } else {
      if (this.options.wheel) {
        newY = Math.round(newY / this.itemHeight) * this.itemHeight;
        time = this.options.wheel.adjustTime || 400;
      }
    }

    var easing = ease.swipe;
    if (this.options.snap) {
      var snap = this._nearestSnap(newX, newY);
      this.currentPage = snap;
      time = this.options.snapSpeed || Math.max(Math.max(Math.min(Math.abs(newX - snap.x), 1000), Math.min(Math.abs(newY - snap.y), 1000)), 300);
      newX = snap.x;
      newY = snap.y;

      this.directionX = 0;
      this.directionY = 0;
A
update  
AmyFoxFN 已提交
2065
      easing = this.options.snap.easing || ease.bounce;
D
dolymood 已提交
2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077
    }

    if (newX !== this.x || newY !== this.y) {
      // change easing function when scroller goes out of the boundaries
      if (newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY) {
        easing = ease.swipeBounce;
      }
      this.scrollTo(newX, newY, time, easing);
      return;
    }

    if (this.options.wheel) {
D
dolymood 已提交
2078
      this.selectedIndex = Math.round(Math.abs(this.y / this.itemHeight));
D
dolymood 已提交
2079 2080 2081 2082 2083 2084 2085
    }
    this.trigger('scrollEnd', {
      x: this.x,
      y: this.y
    });
  };

D
dolymood 已提交
2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106
  BScroll.prototype._checkClick = function (e) {
    // when in the process of pulling down, it should not prevent click
    var preventClick = this.stopFromTransition && !this.pulling;
    this.stopFromTransition = false;

    // we scrolled less than 15 pixels
    if (!this.moved) {
      if (this.options.wheel) {
        if (this.target && this.target.className === this.options.wheel.wheelWrapperClass) {
          var index = Math.abs(Math.round(this.y / this.itemHeight));
          var _offset = Math.round((this.pointY + offset(this.target).top - this.itemHeight / 2) / this.itemHeight);
          this.target = this.items[index + _offset];
        }
        this.scrollToElement(this.target, this.options.wheel.adjustTime || 400, true, true, ease.swipe);
        return true;
      } else {
        if (!preventClick) {
          if (this.options.tap) {
            tap(e, this.options.tap);
          }

A
update  
AmyFoxFN 已提交
2107
          if (this.options.click && !preventDefaultException(e.target, this.options.preventDefaultException)) {
D
dolymood 已提交
2108 2109 2110 2111 2112 2113 2114 2115 2116 2117
            click(e);
          }
          return true;
        }
        return false;
      }
    }
    return false;
  };

D
dolymood 已提交
2118 2119 2120 2121 2122 2123
  BScroll.prototype._resize = function () {
    var _this = this;

    if (!this.enabled) {
      return;
    }
D
dolymood 已提交
2124 2125 2126 2127
    // fix a scroll problem under Android condition
    if (isAndroid) {
      this.wrapper.scrollTop = 0;
    }
D
dolymood 已提交
2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140
    clearTimeout(this.resizeTimeout);
    this.resizeTimeout = setTimeout(function () {
      _this.refresh();
    }, this.options.resizePolling);
  };

  BScroll.prototype._startProbe = function () {
    cancelAnimationFrame(this.probeTimer);
    this.probeTimer = requestAnimationFrame(probe);

    var me = this;

    function probe() {
D
dolymood 已提交
2141 2142
      var pos = me.getComputedPosition();
      me.trigger('scroll', pos);
D
dolymood 已提交
2143
      if (!me.isInTransition) {
A
update  
AmyFoxFN 已提交
2144
        me.trigger('scrollEnd', pos);
D
dolymood 已提交
2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198
        return;
      }
      me.probeTimer = requestAnimationFrame(probe);
    }
  };

  BScroll.prototype._transitionProperty = function () {
    var property = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform';

    this.scrollerStyle[style.transitionProperty] = property;
  };

  BScroll.prototype._transitionTime = function () {
    var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

    this.scrollerStyle[style.transitionDuration] = time + 'ms';

    if (this.options.wheel) {
      for (var i = 0; i < this.items.length; i++) {
        this.items[i].style[style.transitionDuration] = time + 'ms';
      }
    }

    if (this.indicators) {
      for (var _i = 0; _i < this.indicators.length; _i++) {
        this.indicators[_i].transitionTime(time);
      }
    }
  };

  BScroll.prototype._transitionTimingFunction = function (easing) {
    this.scrollerStyle[style.transitionTimingFunction] = easing;

    if (this.options.wheel) {
      for (var i = 0; i < this.items.length; i++) {
        this.items[i].style[style.transitionTimingFunction] = easing;
      }
    }

    if (this.indicators) {
      for (var _i2 = 0; _i2 < this.indicators.length; _i2++) {
        this.indicators[_i2].transitionTimingFunction(easing);
      }
    }
  };

  BScroll.prototype._transitionEnd = function (e) {
    if (e.target !== this.scroller || !this.isInTransition) {
      return;
    }

    this._transitionTime();
    if (!this.pulling && !this.resetPosition(this.options.bounceTime, ease.bounce)) {
      this.isInTransition = false;
A
AmyFoxFN 已提交
2199
      if (this.options.probeType !== PROBE_REALTIME) {
A
update  
AmyFoxFN 已提交
2200 2201 2202 2203 2204
        this.trigger('scrollEnd', {
          x: this.x,
          y: this.y
        });
      }
D
dolymood 已提交
2205 2206 2207 2208
    }
  };

  BScroll.prototype._translate = function (x, y) {
A
AmyFoxFN 已提交
2209
    assert(!isUndef(x) && !isUndef(y), 'Oops! translate x or y is null or undefined. please check your code.');
D
dolymood 已提交
2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271
    if (this.options.useTransform) {
      this.scrollerStyle[style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;
    } else {
      x = Math.round(x);
      y = Math.round(y);
      this.scrollerStyle.left = x + 'px';
      this.scrollerStyle.top = y + 'px';
    }

    if (this.options.wheel) {
      var _options$wheel$rotate = this.options.wheel.rotate,
          rotate = _options$wheel$rotate === undefined ? 25 : _options$wheel$rotate;

      for (var i = 0; i < this.items.length; i++) {
        var deg = rotate * (y / this.itemHeight + i);
        this.items[i].style[style.transform] = 'rotateX(' + deg + 'deg)';
      }
    }

    this.x = x;
    this.y = y;

    if (this.indicators) {
      for (var _i3 = 0; _i3 < this.indicators.length; _i3++) {
        this.indicators[_i3].updatePosition();
      }
    }
  };

  BScroll.prototype._animate = function (destX, destY, duration, easingFn) {
    var me = this;
    var startX = this.x;
    var startY = this.y;
    var startTime = getNow();
    var destTime = startTime + duration;

    function step() {
      var now = getNow();

      if (now >= destTime) {
        me.isAnimating = false;
        me._translate(destX, destY);

        if (!me.pulling && !me.resetPosition(me.options.bounceTime)) {
          me.trigger('scrollEnd', {
            x: me.x,
            y: me.y
          });
        }
        return;
      }
      now = (now - startTime) / duration;
      var easing = easingFn(now);
      var newX = (destX - startX) * easing + startX;
      var newY = (destY - startY) * easing + startY;

      me._translate(newX, newY);

      if (me.isAnimating) {
        me.animateTimer = requestAnimationFrame(step);
      }

A
AmyFoxFN 已提交
2272
      if (me.options.probeType === PROBE_REALTIME) {
D
dolymood 已提交
2273
        me.trigger('scroll', {
D
dolymood 已提交
2274 2275
          x: me.x,
          y: me.y
D
dolymood 已提交
2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306
        });
      }
    }

    this.isAnimating = true;
    cancelAnimationFrame(this.animateTimer);
    step();
  };

  BScroll.prototype.scrollBy = function (x, y) {
    var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
    var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ease.bounce;

    x = this.x + x;
    y = this.y + y;

    this.scrollTo(x, y, time, easing);
  };

  BScroll.prototype.scrollTo = function (x, y) {
    var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
    var easing = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ease.bounce;

    this.isInTransition = this.options.useTransition && time > 0 && (x !== this.x || y !== this.y);

    if (!time || this.options.useTransition) {
      this._transitionProperty();
      this._transitionTimingFunction(easing.style);
      this._transitionTime(time);
      this._translate(x, y);

A
AmyFoxFN 已提交
2307
      if (time && this.options.probeType === PROBE_REALTIME) {
D
dolymood 已提交
2308 2309 2310 2311 2312 2313 2314 2315 2316
        this._startProbe();
      }

      if (this.options.wheel) {
        if (y > 0) {
          this.selectedIndex = 0;
        } else if (y < this.maxScrollY) {
          this.selectedIndex = this.items.length - 1;
        } else {
D
dolymood 已提交
2317
          this.selectedIndex = Math.round(Math.abs(y / this.itemHeight));
D
dolymood 已提交
2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330
        }
      }
    } else {
      this._animate(x, y, time, easing.fn);
    }
  };

  BScroll.prototype.scrollToElement = function (el, time, offsetX, offsetY, easing) {
    if (!el) {
      return;
    }
    el = el.nodeType ? el : this.scroller.querySelector(el);

D
dolymood 已提交
2331
    if (this.options.wheel && el.className !== this.options.wheel.wheelItemClass) {
D
dolymood 已提交
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363
      return;
    }

    var pos = offset(el);
    pos.left -= this.wrapperOffset.left;
    pos.top -= this.wrapperOffset.top;

    // if offsetX/Y are true we center the element to the screen
    if (offsetX === true) {
      offsetX = Math.round(el.offsetWidth / 2 - this.wrapper.offsetWidth / 2);
    }
    if (offsetY === true) {
      offsetY = Math.round(el.offsetHeight / 2 - this.wrapper.offsetHeight / 2);
    }

    pos.left -= offsetX || 0;
    pos.top -= offsetY || 0;
    pos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;
    pos.top = pos.top > 0 ? 0 : pos.top < this.maxScrollY ? this.maxScrollY : pos.top;

    if (this.options.wheel) {
      pos.top = Math.round(pos.top / this.itemHeight) * this.itemHeight;
    }

    this.scrollTo(pos.left, pos.top, time, easing);
  };

  BScroll.prototype.resetPosition = function () {
    var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
    var easeing = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ease.bounce;

    var x = this.x;
D
dolymood 已提交
2364 2365
    var roundX = Math.round(x);
    if (!this.hasHorizontalScroll || roundX > 0) {
D
dolymood 已提交
2366
      x = 0;
D
dolymood 已提交
2367
    } else if (roundX < this.maxScrollX) {
D
dolymood 已提交
2368 2369 2370 2371
      x = this.maxScrollX;
    }

    var y = this.y;
D
dolymood 已提交
2372 2373
    var roundY = Math.round(y);
    if (!this.hasVerticalScroll || roundY > 0) {
D
dolymood 已提交
2374
      y = 0;
D
dolymood 已提交
2375
    } else if (roundY < this.maxScrollY) {
D
dolymood 已提交
2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432
      y = this.maxScrollY;
    }

    if (x === this.x && y === this.y) {
      return false;
    }

    this.scrollTo(x, y, time, easeing);

    return true;
  };

  BScroll.prototype.getComputedPosition = function () {
    var matrix = window.getComputedStyle(this.scroller, null);
    var x = void 0;
    var y = void 0;

    if (this.options.useTransform) {
      matrix = matrix[style.transform].split(')')[0].split(', ');
      x = +(matrix[12] || matrix[4]);
      y = +(matrix[13] || matrix[5]);
    } else {
      x = +matrix.left.replace(/[^-\d.]/g, '');
      y = +matrix.top.replace(/[^-\d.]/g, '');
    }

    return {
      x: x,
      y: y
    };
  };

  BScroll.prototype.stop = function () {
    if (this.options.useTransition && this.isInTransition) {
      this.isInTransition = false;
      var pos = this.getComputedPosition();
      this._translate(pos.x, pos.y);
      if (this.options.wheel) {
        this.target = this.items[Math.round(-pos.y / this.itemHeight)];
      } else {
        this.trigger('scrollEnd', {
          x: this.x,
          y: this.y
        });
      }
      this.stopFromTransition = true;
    } else if (!this.options.useTransition && this.isAnimating) {
      this.isAnimating = false;
      this.trigger('scrollEnd', {
        x: this.x,
        y: this.y
      });
      this.stopFromTransition = true;
    }
  };

  BScroll.prototype.destroy = function () {
D
dolymood 已提交
2433 2434 2435
    this.destroyed = true;
    this.trigger('destroy');

D
dolymood 已提交
2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450
    this._removeDOMEvents();
    // remove custom events
    this._events = {};
  };
}

function snapMixin(BScroll) {
  BScroll.prototype._initSnap = function () {
    var _this = this;

    this.currentPage = {};
    var snap = this.options.snap;

    if (snap.loop) {
      var children = this.scroller.children;
A
AmyFoxFN 已提交
2451
      if (children.length > 1) {
D
dolymood 已提交
2452 2453
        prepend(children[children.length - 1].cloneNode(true), this.scroller);
        this.scroller.appendChild(children[1].cloneNode(true));
A
AmyFoxFN 已提交
2454 2455 2456
      } else {
        // Loop does not make any sense if there is only one child.
        snap.loop = false;
D
dolymood 已提交
2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544
      }
    }

    var el = snap.el;
    if (typeof el === 'string') {
      el = this.scroller.querySelectorAll(el);
    }

    this.on('refresh', function () {
      _this.pages = [];

      if (!_this.wrapperWidth || !_this.wrapperHeight || !_this.scrollerWidth || !_this.scrollerHeight) {
        return;
      }

      var stepX = snap.stepX || _this.wrapperWidth;
      var stepY = snap.stepY || _this.wrapperHeight;

      var x = 0;
      var y = void 0;
      var cx = void 0;
      var cy = void 0;
      var i = 0;
      var l = void 0;
      var m = 0;
      var n = void 0;
      var rect = void 0;
      if (!el) {
        cx = Math.round(stepX / 2);
        cy = Math.round(stepY / 2);

        while (x > -_this.scrollerWidth) {
          _this.pages[i] = [];
          l = 0;
          y = 0;

          while (y > -_this.scrollerHeight) {
            _this.pages[i][l] = {
              x: Math.max(x, _this.maxScrollX),
              y: Math.max(y, _this.maxScrollY),
              width: stepX,
              height: stepY,
              cx: x - cx,
              cy: y - cy
            };

            y -= stepY;
            l++;
          }

          x -= stepX;
          i++;
        }
      } else {
        l = el.length;
        n = -1;

        for (; i < l; i++) {
          rect = getRect(el[i]);
          if (i === 0 || rect.left <= getRect(el[i - 1]).left) {
            m = 0;
            n++;
          }

          if (!_this.pages[m]) {
            _this.pages[m] = [];
          }

          x = Math.max(-rect.left, _this.maxScrollX);
          y = Math.max(-rect.top, _this.maxScrollY);
          cx = x - Math.round(rect.width / 2);
          cy = y - Math.round(rect.height / 2);

          _this.pages[m][n] = {
            x: x,
            y: y,
            width: rect.width,
            height: rect.height,
            cx: cx,
            cy: cy
          };

          if (x > _this.maxScrollX) {
            m++;
          }
        }
      }

A
AmyFoxFN 已提交
2545 2546 2547 2548 2549
      _this._checkSnapLoop();

      var initPageX = snap._loopX ? 1 : 0;
      var initPageY = snap._loopY ? 1 : 0;
      _this._goToPage(_this.currentPage.pageX || initPageX, _this.currentPage.pageY || initPageY, 0);
D
dolymood 已提交
2550

A
AmyFoxFN 已提交
2551
      // Update snap threshold if needed.
D
dolymood 已提交
2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563
      var snapThreshold = snap.threshold;
      if (snapThreshold % 1 === 0) {
        _this.snapThresholdX = snapThreshold;
        _this.snapThresholdY = snapThreshold;
      } else {
        _this.snapThresholdX = Math.round(_this.pages[_this.currentPage.pageX][_this.currentPage.pageY].width * snapThreshold);
        _this.snapThresholdY = Math.round(_this.pages[_this.currentPage.pageX][_this.currentPage.pageY].height * snapThreshold);
      }
    });

    this.on('scrollEnd', function () {
      if (snap.loop) {
A
AmyFoxFN 已提交
2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577
        if (snap._loopX) {
          if (_this.currentPage.pageX === 0) {
            _this._goToPage(_this.pages.length - 2, _this.currentPage.pageY, 0);
          }
          if (_this.currentPage.pageX === _this.pages.length - 1) {
            _this._goToPage(1, _this.currentPage.pageY, 0);
          }
        } else {
          if (_this.currentPage.pageY === 0) {
            _this._goToPage(_this.currentPage.pageX, _this.pages[0].length - 2, 0);
          }
          if (_this.currentPage.pageY === _this.pages[0].length - 1) {
            _this._goToPage(_this.currentPage.pageX, 1, 0);
          }
D
dolymood 已提交
2578 2579 2580 2581 2582 2583 2584 2585
        }
      }
    });

    if (snap.listenFlick !== false) {
      this.on('flick', function () {
        var time = snap.speed || Math.max(Math.max(Math.min(Math.abs(_this.x - _this.startX), 1000), Math.min(Math.abs(_this.y - _this.startY), 1000)), 300);

D
dolymood 已提交
2586
        _this._goToPage(_this.currentPage.pageX + _this.directionX, _this.currentPage.pageY + _this.directionY, time);
D
dolymood 已提交
2587 2588
      });
    }
D
dolymood 已提交
2589 2590 2591 2592

    this.on('destroy', function () {
      if (snap.loop) {
        var _children = _this.scroller.children;
D
dolymood 已提交
2593 2594 2595 2596
        if (_children.length > 2) {
          removeChild(_this.scroller, _children[_children.length - 1]);
          removeChild(_this.scroller, _children[0]);
        }
D
dolymood 已提交
2597 2598
      }
    });
D
dolymood 已提交
2599 2600
  };

A
AmyFoxFN 已提交
2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618
  BScroll.prototype._checkSnapLoop = function () {
    var snap = this.options.snap;

    if (!snap.loop || !this.pages) {
      return;
    }

    if (this.pages.length > 1) {
      snap._loopX = true;
    }
    if (this.pages[0] && this.pages[0].length > 1) {
      snap._loopY = true;
    }
    if (snap._loopX && snap._loopY) {
      warn('Loop does not support two direction at the same time.');
    }
  };

D
dolymood 已提交
2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691
  BScroll.prototype._nearestSnap = function (x, y) {
    if (!this.pages.length) {
      return { x: 0, y: 0, pageX: 0, pageY: 0 };
    }

    var i = 0;
    // Check if we exceeded the snap threshold
    if (Math.abs(x - this.absStartX) <= this.snapThresholdX && Math.abs(y - this.absStartY) <= this.snapThresholdY) {
      return this.currentPage;
    }

    if (x > 0) {
      x = 0;
    } else if (x < this.maxScrollX) {
      x = this.maxScrollX;
    }

    if (y > 0) {
      y = 0;
    } else if (y < this.maxScrollY) {
      y = this.maxScrollY;
    }

    var l = this.pages.length;
    for (; i < l; i++) {
      if (x >= this.pages[i][0].cx) {
        x = this.pages[i][0].x;
        break;
      }
    }

    l = this.pages[i].length;

    var m = 0;
    for (; m < l; m++) {
      if (y >= this.pages[0][m].cy) {
        y = this.pages[0][m].y;
        break;
      }
    }

    if (i === this.currentPage.pageX) {
      i += this.directionX;

      if (i < 0) {
        i = 0;
      } else if (i >= this.pages.length) {
        i = this.pages.length - 1;
      }

      x = this.pages[i][0].x;
    }

    if (m === this.currentPage.pageY) {
      m += this.directionY;

      if (m < 0) {
        m = 0;
      } else if (m >= this.pages[0].length) {
        m = this.pages[0].length - 1;
      }

      y = this.pages[0][m].y;
    }

    return {
      x: x,
      y: y,
      pageX: i,
      pageY: m
    };
  };

D
dolymood 已提交
2692 2693 2694
  BScroll.prototype._goToPage = function (x) {
    var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
    var time = arguments[2];
A
update  
AmyFoxFN 已提交
2695
    var easing = arguments[3];
D
dolymood 已提交
2696 2697

    var snap = this.options.snap;
D
dolymood 已提交
2698

D
dolymood 已提交
2699
    if (!snap || !this.pages) {
D
dolymood 已提交
2700 2701 2702
      return;
    }

A
update  
AmyFoxFN 已提交
2703 2704
    easing = easing || snap.easing || ease.bounce;

D
dolymood 已提交
2705 2706 2707 2708 2709 2710
    if (x >= this.pages.length) {
      x = this.pages.length - 1;
    } else if (x < 0) {
      x = 0;
    }

D
dolymood 已提交
2711 2712 2713 2714
    if (!this.pages[x]) {
      return;
    }

D
dolymood 已提交
2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734
    if (y >= this.pages[x].length) {
      y = this.pages[x].length - 1;
    } else if (y < 0) {
      y = 0;
    }

    var posX = this.pages[x][y].x;
    var posY = this.pages[x][y].y;

    time = time === undefined ? snap.speed || Math.max(Math.max(Math.min(Math.abs(posX - this.x), 1000), Math.min(Math.abs(posY - this.y), 1000)), 300) : time;

    this.currentPage = {
      x: posX,
      y: posY,
      pageX: x,
      pageY: y
    };
    this.scrollTo(posX, posY, time, easing);
  };

D
dolymood 已提交
2735 2736
  BScroll.prototype.goToPage = function (x, y, time, easing) {
    var snap = this.options.snap;
A
AmyFoxFN 已提交
2737 2738 2739 2740 2741 2742 2743 2744
    if (!snap) {
      return;
    }

    if (snap.loop) {
      var len = void 0;
      if (snap._loopX) {
        len = this.pages.length - 2;
D
dolymood 已提交
2745 2746 2747 2748 2749 2750
        if (x >= len) {
          x = len - 1;
        } else if (x < 0) {
          x = 0;
        }
        x += 1;
A
AmyFoxFN 已提交
2751 2752 2753 2754 2755 2756 2757 2758
      } else {
        len = this.pages[0].length - 2;
        if (y >= len) {
          y = len - 1;
        } else if (y < 0) {
          y = 0;
        }
        y += 1;
D
dolymood 已提交
2759 2760
      }
    }
A
AmyFoxFN 已提交
2761
    this._goToPage(x, y, time, easing);
D
dolymood 已提交
2762 2763
  };

D
dolymood 已提交
2764
  BScroll.prototype.next = function (time, easing) {
A
AmyFoxFN 已提交
2765 2766 2767 2768 2769
    var snap = this.options.snap;
    if (!snap) {
      return;
    }

D
dolymood 已提交
2770 2771 2772 2773 2774 2775 2776 2777 2778
    var x = this.currentPage.pageX;
    var y = this.currentPage.pageY;

    x++;
    if (x >= this.pages.length && this.hasVerticalScroll) {
      x = 0;
      y++;
    }

D
dolymood 已提交
2779
    this._goToPage(x, y, time, easing);
D
dolymood 已提交
2780 2781 2782
  };

  BScroll.prototype.prev = function (time, easing) {
A
AmyFoxFN 已提交
2783 2784 2785 2786 2787
    var snap = this.options.snap;
    if (!snap) {
      return;
    }

D
dolymood 已提交
2788 2789 2790 2791 2792 2793 2794 2795 2796
    var x = this.currentPage.pageX;
    var y = this.currentPage.pageY;

    x--;
    if (x < 0 && this.hasVerticalScroll) {
      x = 0;
      y--;
    }

D
dolymood 已提交
2797
    this._goToPage(x, y, time, easing);
D
dolymood 已提交
2798 2799 2800
  };

  BScroll.prototype.getCurrentPage = function () {
D
dolymood 已提交
2801
    var snap = this.options.snap;
A
AmyFoxFN 已提交
2802 2803 2804 2805 2806 2807 2808 2809
    if (!snap) {
      return null;
    }

    if (snap.loop) {
      var currentPage = void 0;
      if (snap._loopX) {
        currentPage = extend({}, this.currentPage, {
D
dolymood 已提交
2810 2811
          pageX: this.currentPage.pageX - 1
        });
A
AmyFoxFN 已提交
2812 2813 2814 2815
      } else {
        currentPage = extend({}, this.currentPage, {
          pageY: this.currentPage.pageY - 1
        });
D
dolymood 已提交
2816
      }
A
AmyFoxFN 已提交
2817
      return currentPage;
D
dolymood 已提交
2818
    }
A
AmyFoxFN 已提交
2819
    return this.currentPage;
D
dolymood 已提交
2820 2821 2822 2823
  };
}

function wheelMixin(BScroll) {
D
dolymood 已提交
2824 2825 2826
  BScroll.prototype.wheelTo = function () {
    var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

D
dolymood 已提交
2827 2828 2829 2830 2831 2832 2833 2834 2835
    if (this.options.wheel) {
      this.y = -index * this.itemHeight;
      this.scrollTo(0, this.y);
    }
  };

  BScroll.prototype.getSelectedIndex = function () {
    return this.options.wheel && this.selectedIndex;
  };
D
dolymood 已提交
2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849

  BScroll.prototype._initWheel = function () {
    var wheel = this.options.wheel;
    if (!wheel.wheelWrapperClass) {
      wheel.wheelWrapperClass = 'wheel-scroll';
    }
    if (!wheel.wheelItemClass) {
      wheel.wheelItemClass = 'wheel-item';
    }
    if (wheel.selectedIndex === undefined) {
      wheel.selectedIndex = 0;
      warn('wheel option selectedIndex is required!');
    }
  };
D
dolymood 已提交
2850 2851 2852 2853 2854 2855 2856 2857
}

var INDICATOR_MIN_LEN = 8;

function scrollbarMixin(BScroll) {
  BScroll.prototype._initScrollbar = function () {
    var _this = this;

A
update  
AmyFoxFN 已提交
2858 2859 2860 2861 2862
    var _options$scrollbar = this.options.scrollbar,
        _options$scrollbar$fa = _options$scrollbar.fade,
        fade = _options$scrollbar$fa === undefined ? true : _options$scrollbar$fa,
        _options$scrollbar$in = _options$scrollbar.interactive,
        interactive = _options$scrollbar$in === undefined ? false : _options$scrollbar$in;
D
dolymood 已提交
2863 2864 2865 2866 2867 2868 2869 2870

    this.indicators = [];
    var indicator = void 0;

    if (this.options.scrollX) {
      indicator = {
        el: createScrollbar('horizontal'),
        direction: 'horizontal',
A
update  
AmyFoxFN 已提交
2871 2872
        fade: fade,
        interactive: interactive
D
dolymood 已提交
2873 2874 2875 2876 2877 2878 2879 2880 2881 2882
      };
      this._insertScrollBar(indicator.el);

      this.indicators.push(new Indicator(this, indicator));
    }

    if (this.options.scrollY) {
      indicator = {
        el: createScrollbar('vertical'),
        direction: 'vertical',
A
update  
AmyFoxFN 已提交
2883 2884
        fade: fade,
        interactive: interactive
D
dolymood 已提交
2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920
      };
      this._insertScrollBar(indicator.el);
      this.indicators.push(new Indicator(this, indicator));
    }

    this.on('refresh', function () {
      for (var i = 0; i < _this.indicators.length; i++) {
        _this.indicators[i].refresh();
      }
    });

    if (fade) {
      this.on('scrollEnd', function () {
        for (var i = 0; i < _this.indicators.length; i++) {
          _this.indicators[i].fade();
        }
      });

      this.on('scrollCancel', function () {
        for (var i = 0; i < _this.indicators.length; i++) {
          _this.indicators[i].fade();
        }
      });

      this.on('scrollStart', function () {
        for (var i = 0; i < _this.indicators.length; i++) {
          _this.indicators[i].fade(true);
        }
      });

      this.on('beforeScrollStart', function () {
        for (var i = 0; i < _this.indicators.length; i++) {
          _this.indicators[i].fade(true, true);
        }
      });
    }
D
dolymood 已提交
2921 2922 2923 2924

    this.on('destroy', function () {
      _this._removeScrollBars();
    });
D
dolymood 已提交
2925 2926 2927 2928 2929 2930 2931 2932
  };

  BScroll.prototype._insertScrollBar = function (scrollbar) {
    this.wrapper.appendChild(scrollbar);
  };

  BScroll.prototype._removeScrollBars = function () {
    for (var i = 0; i < this.indicators.length; i++) {
A
update  
AmyFoxFN 已提交
2933
      this.indicators[i].destroy();
D
dolymood 已提交
2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975
    }
  };
}

function createScrollbar(direction) {
  var scrollbar = document.createElement('div');
  var indicator = document.createElement('div');

  scrollbar.style.cssText = 'position:absolute;z-index:9999;pointerEvents:none';
  indicator.style.cssText = 'box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px;';

  indicator.className = 'bscroll-indicator';

  if (direction === 'horizontal') {
    scrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';
    indicator.style.height = '100%';
    scrollbar.className = 'bscroll-horizontal-scrollbar';
  } else {
    scrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';
    indicator.style.width = '100%';
    scrollbar.className = 'bscroll-vertical-scrollbar';
  }

  scrollbar.style.cssText += ';overflow:hidden';
  scrollbar.appendChild(indicator);

  return scrollbar;
}

function Indicator(scroller, options) {
  this.wrapper = options.el;
  this.wrapperStyle = this.wrapper.style;
  this.indicator = this.wrapper.children[0];
  this.indicatorStyle = this.indicator.style;
  this.scroller = scroller;
  this.direction = options.direction;
  if (options.fade) {
    this.visible = 0;
    this.wrapperStyle.opacity = '0';
  } else {
    this.visible = 1;
  }
A
update  
AmyFoxFN 已提交
2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986

  this.sizeRatioX = 1;
  this.sizeRatioY = 1;
  this.maxPosX = 0;
  this.maxPosY = 0;
  this.x = 0;
  this.y = 0;

  if (options.interactive) {
    this._addDOMEvents();
  }
D
dolymood 已提交
2987 2988
}

A
update  
AmyFoxFN 已提交
2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007
Indicator.prototype.handleEvent = function (e) {
  switch (e.type) {
    case 'touchstart':
    case 'mousedown':
      this._start(e);
      break;
    case 'touchmove':
    case 'mousemove':
      this._move(e);
      break;
    case 'touchend':
    case 'mouseup':
    case 'touchcancel':
    case 'mousecancel':
      this._end(e);
      break;
  }
};

D
dolymood 已提交
3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094
Indicator.prototype.refresh = function () {
  this.transitionTime();
  this._calculate();
  this.updatePosition();
};

Indicator.prototype.fade = function (visible, hold) {
  var _this2 = this;

  if (hold && !this.visible) {
    return;
  }

  var time = visible ? 250 : 500;

  visible = visible ? '1' : '0';

  this.wrapperStyle[style.transitionDuration] = time + 'ms';

  clearTimeout(this.fadeTimeout);
  this.fadeTimeout = setTimeout(function () {
    _this2.wrapperStyle.opacity = visible;
    _this2.visible = +visible;
  }, 0);
};

Indicator.prototype.updatePosition = function () {
  if (this.direction === 'vertical') {
    var y = Math.round(this.sizeRatioY * this.scroller.y);

    if (y < 0) {
      this.transitionTime(500);
      var height = Math.max(this.indicatorHeight + y * 3, INDICATOR_MIN_LEN);
      this.indicatorStyle.height = height + 'px';
      y = 0;
    } else if (y > this.maxPosY) {
      this.transitionTime(500);
      var _height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, INDICATOR_MIN_LEN);
      this.indicatorStyle.height = _height + 'px';
      y = this.maxPosY + this.indicatorHeight - _height;
    } else {
      this.indicatorStyle.height = this.indicatorHeight + 'px';
    }
    this.y = y;

    if (this.scroller.options.useTransform) {
      this.indicatorStyle[style.transform] = 'translateY(' + y + 'px)' + this.scroller.translateZ;
    } else {
      this.indicatorStyle.top = y + 'px';
    }
  } else {
    var x = Math.round(this.sizeRatioX * this.scroller.x);

    if (x < 0) {
      this.transitionTime(500);
      var width = Math.max(this.indicatorWidth + x * 3, INDICATOR_MIN_LEN);
      this.indicatorStyle.width = width + 'px';
      x = 0;
    } else if (x > this.maxPosX) {
      this.transitionTime(500);
      var _width = Math.max(this.indicatorWidth - (x - this.maxPosX) * 3, INDICATOR_MIN_LEN);
      this.indicatorStyle.width = _width + 'px';
      x = this.maxPosX + this.indicatorWidth - _width;
    } else {
      this.indicatorStyle.width = this.indicatorWidth + 'px';
    }

    this.x = x;

    if (this.scroller.options.useTransform) {
      this.indicatorStyle[style.transform] = 'translateX(' + x + 'px)' + this.scroller.translateZ;
    } else {
      this.indicatorStyle.left = x + 'px';
    }
  }
};

Indicator.prototype.transitionTime = function () {
  var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

  this.indicatorStyle[style.transitionDuration] = time + 'ms';
};

Indicator.prototype.transitionTimingFunction = function (easing) {
  this.indicatorStyle[style.transitionTimingFunction] = easing;
};

A
update  
AmyFoxFN 已提交
3095 3096
Indicator.prototype.destroy = function () {
  this._removeDOMEvents();
D
dolymood 已提交
3097 3098 3099
  this.wrapper.parentNode.removeChild(this.wrapper);
};

A
update  
AmyFoxFN 已提交
3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202
Indicator.prototype._start = function (e) {
  var point = e.touches ? e.touches[0] : e;

  e.preventDefault();
  e.stopPropagation();

  this.transitionTime();

  this.initiated = true;
  this.moved = false;
  this.lastPointX = point.pageX;
  this.lastPointY = point.pageY;

  this.startTime = getNow();

  this._handleMoveEvents(addEvent);
  this.scroller.trigger('beforeScrollStart');
};

Indicator.prototype._move = function (e) {
  var point = e.touches ? e.touches[0] : e;

  e.preventDefault();
  e.stopPropagation();

  if (!this.moved) {
    this.scroller.trigger('scrollStart');
  }

  this.moved = true;

  var deltaX = point.pageX - this.lastPointX;
  this.lastPointX = point.pageX;

  var deltaY = point.pageY - this.lastPointY;
  this.lastPointY = point.pageY;

  var newX = this.x + deltaX;
  var newY = this.y + deltaY;

  this._pos(newX, newY);
};

Indicator.prototype._end = function (e) {
  if (!this.initiated) {
    return;
  }
  this.initiated = false;

  e.preventDefault();
  e.stopPropagation();

  this._handleMoveEvents(removeEvent);

  var snapOption = this.scroller.options.snap;
  if (snapOption) {
    var speed = snapOption.speed,
        _snapOption$easing = snapOption.easing,
        easing = _snapOption$easing === undefined ? ease.bounce : _snapOption$easing;

    var snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);

    var time = speed || Math.max(Math.max(Math.min(Math.abs(this.scroller.x - snap.x), 1000), Math.min(Math.abs(this.scroller.y - snap.y), 1000)), 300);

    if (this.scroller.x !== snap.x || this.scroller.y !== snap.y) {
      this.scroller.directionX = 0;
      this.scroller.directionY = 0;
      this.scroller.currentPage = snap;
      this.scroller.scrollTo(snap.x, snap.y, time, easing);
    }
  }

  if (this.moved) {
    this.scroller.trigger('scrollEnd', {
      x: this.scroller.x,
      y: this.scroller.y
    });
  }
};

Indicator.prototype._pos = function (x, y) {
  if (x < 0) {
    x = 0;
  } else if (x > this.maxPosX) {
    x = this.maxPosX;
  }

  if (y < 0) {
    y = 0;
  } else if (y > this.maxPosY) {
    y = this.maxPosY;
  }

  x = Math.round(x / this.sizeRatioX);
  y = Math.round(y / this.sizeRatioY);

  this.scroller.scrollTo(x, y);
  this.scroller.trigger('scroll', {
    x: this.scroller.x,
    y: this.scroller.y
  });
};

D
dolymood 已提交
3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222
Indicator.prototype._calculate = function () {
  if (this.direction === 'vertical') {
    var wrapperHeight = this.wrapper.clientHeight;
    this.indicatorHeight = Math.max(Math.round(wrapperHeight * wrapperHeight / (this.scroller.scrollerHeight || wrapperHeight || 1)), INDICATOR_MIN_LEN);
    this.indicatorStyle.height = this.indicatorHeight + 'px';

    this.maxPosY = wrapperHeight - this.indicatorHeight;

    this.sizeRatioY = this.maxPosY / this.scroller.maxScrollY;
  } else {
    var wrapperWidth = this.wrapper.clientWidth;
    this.indicatorWidth = Math.max(Math.round(wrapperWidth * wrapperWidth / (this.scroller.scrollerWidth || wrapperWidth || 1)), INDICATOR_MIN_LEN);
    this.indicatorStyle.width = this.indicatorWidth + 'px';

    this.maxPosX = wrapperWidth - this.indicatorWidth;

    this.sizeRatioX = this.maxPosX / this.scroller.maxScrollX;
  }
};

A
update  
AmyFoxFN 已提交
3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253
Indicator.prototype._addDOMEvents = function () {
  var eventOperation = addEvent;
  this._handleDOMEvents(eventOperation);
};

Indicator.prototype._removeDOMEvents = function () {
  var eventOperation = removeEvent;
  this._handleDOMEvents(eventOperation);
  this._handleMoveEvents(eventOperation);
};

Indicator.prototype._handleMoveEvents = function (eventOperation) {
  if (!this.scroller.options.disableTouch) {
    eventOperation(window, 'touchmove', this);
  }
  if (!this.scroller.options.disableMouse) {
    eventOperation(window, 'mousemove', this);
  }
};

Indicator.prototype._handleDOMEvents = function (eventOperation) {
  if (!this.scroller.options.disableTouch) {
    eventOperation(this.indicator, 'touchstart', this);
    eventOperation(window, 'touchend', this);
  }
  if (!this.scroller.options.disableMouse) {
    eventOperation(this.indicator, 'mousedown', this);
    eventOperation(window, 'mouseup', this);
  }
};

D
dolymood 已提交
3254 3255 3256
function pullDownMixin(BScroll) {
  BScroll.prototype._initPullDown = function () {
    // must watch scroll in real time
A
AmyFoxFN 已提交
3257
    this.options.probeType = PROBE_REALTIME;
D
dolymood 已提交
3258 3259 3260 3261 3262 3263 3264 3265 3266
  };

  BScroll.prototype._checkPullDown = function () {
    var _options$pullDownRefr = this.options.pullDownRefresh,
        _options$pullDownRefr2 = _options$pullDownRefr.threshold,
        threshold = _options$pullDownRefr2 === undefined ? 90 : _options$pullDownRefr2,
        _options$pullDownRefr3 = _options$pullDownRefr.stop,
        stop = _options$pullDownRefr3 === undefined ? 40 : _options$pullDownRefr3;

D
dolymood 已提交
3267
    // check if a real pull down action
D
dolymood 已提交
3268

D
dolymood 已提交
3269
    if (this.directionY !== DIRECTION_DOWN || this.y < threshold) {
D
dolymood 已提交
3270
      return false;
D
dolymood 已提交
3271 3272
    }

D
dolymood 已提交
3273 3274 3275 3276 3277 3278
    if (!this.pulling) {
      this.pulling = true;
      this.trigger('pullingDown');
    }
    this.scrollTo(this.x, stop, this.options.bounceTime, ease.bounce);

D
dolymood 已提交
3279 3280 3281 3282 3283 3284 3285
    return this.pulling;
  };

  BScroll.prototype.finishPullDown = function () {
    this.pulling = false;
    this.resetPosition(this.options.bounceTime, ease.bounce);
  };
A
AmyFoxFN 已提交
3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296

  BScroll.prototype.openPullDown = function () {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

    this.options.pullDownRefresh = config;
    this._initPullDown();
  };

  BScroll.prototype.closePullDown = function () {
    this.options.pullDownRefresh = false;
  };
D
dolymood 已提交
3297 3298 3299 3300 3301
}

function pullUpMixin(BScroll) {
  BScroll.prototype._initPullUp = function () {
    // must watch scroll in real time
A
AmyFoxFN 已提交
3302
    this.options.probeType = PROBE_REALTIME;
D
dolymood 已提交
3303 3304 3305 3306 3307 3308

    this.pullupWatching = false;
    this._watchPullUp();
  };

  BScroll.prototype._watchPullUp = function () {
A
AmyFoxFN 已提交
3309 3310 3311
    if (this.pullupWatching) {
      return;
    }
D
dolymood 已提交
3312
    this.pullupWatching = true;
A
AmyFoxFN 已提交
3313 3314
    this.on('scroll', this._checkToEnd);
  };
D
dolymood 已提交
3315

A
AmyFoxFN 已提交
3316 3317
  BScroll.prototype._checkToEnd = function (pos) {
    var _this = this;
D
dolymood 已提交
3318

A
AmyFoxFN 已提交
3319 3320
    var _options$pullUpLoad$t = this.options.pullUpLoad.threshold,
        threshold = _options$pullUpLoad$t === undefined ? 0 : _options$pullUpLoad$t;
A
update  
AmyFoxFN 已提交
3321

A
AmyFoxFN 已提交
3322 3323 3324 3325 3326 3327 3328
    if (this.movingDirectionY === DIRECTION_UP && pos.y <= this.maxScrollY + threshold) {
      // reset pullupWatching status after scroll end.
      this.once('scrollEnd', function () {
        _this.pullupWatching = false;
      });
      this.trigger('pullingUp');
      this.off('scroll', this._checkToEnd);
D
dolymood 已提交
3329 3330 3331 3332
    }
  };

  BScroll.prototype.finishPullUp = function () {
A
update  
AmyFoxFN 已提交
3333
    var _this2 = this;
D
dolymood 已提交
3334

A
update  
AmyFoxFN 已提交
3335
    if (this.pullupWatching) {
D
dolymood 已提交
3336
      this.once('scrollEnd', function () {
A
update  
AmyFoxFN 已提交
3337
        _this2._watchPullUp();
D
dolymood 已提交
3338 3339 3340 3341 3342
      });
    } else {
      this._watchPullUp();
    }
  };
A
AmyFoxFN 已提交
3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358

  BScroll.prototype.openPullUp = function () {
    var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;

    this.options.pullUpLoad = config;
    this._initPullUp();
  };

  BScroll.prototype.closePullUp = function () {
    this.options.pullUpLoad = false;
    if (!this.pullupWatching) {
      return;
    }
    this.pullupWatching = false;
    this.off('scroll', this._checkToEnd);
  };
D
dolymood 已提交
3359 3360
}

A
update  
AmyFoxFN 已提交
3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494
function mouseWheelMixin(BScroll) {
  BScroll.prototype._initMouseWheel = function () {
    var _this = this;

    this._handleMouseWheelEvent(addEvent);

    this.on('destroy', function () {
      clearTimeout(_this.mouseWheelTimer);
      _this._handleMouseWheelEvent(removeEvent);
    });

    this.firstWheelOpreation = true;
  };

  BScroll.prototype._handleMouseWheelEvent = function (eventOperation) {
    eventOperation(this.wrapper, 'wheel', this);
    eventOperation(this.wrapper, 'mousewheel', this);
    eventOperation(this.wrapper, 'DOMMouseScroll', this);
  };

  BScroll.prototype._onMouseWheel = function (e) {
    var _this2 = this;

    if (!this.enabled) {
      return;
    }
    e.preventDefault();

    if (this.firstWheelOpreation) {
      this.trigger('scrollStart');
    }
    this.firstWheelOpreation = false;

    clearTimeout(this.mouseWheelTimer);
    this.mouseWheelTimer = setTimeout(function () {
      if (!_this2.options.snap) {
        _this2.trigger('scrollEnd', {
          x: _this2.x,
          y: _this2.y
        });
      }
      _this2.firstWheelOpreation = true;
    }, 400);

    var _options$mouseWheel = this.options.mouseWheel,
        _options$mouseWheel$s = _options$mouseWheel.speed,
        speed = _options$mouseWheel$s === undefined ? 20 : _options$mouseWheel$s,
        _options$mouseWheel$i = _options$mouseWheel.invert,
        invert = _options$mouseWheel$i === undefined ? false : _options$mouseWheel$i;

    var wheelDeltaX = void 0;
    var wheelDeltaY = void 0;

    switch (true) {
      case 'deltaX' in e:
        if (e.deltaMode === 1) {
          wheelDeltaX = -e.deltaX * speed;
          wheelDeltaY = -e.deltaY * speed;
        } else {
          wheelDeltaX = -e.deltaX;
          wheelDeltaY = -e.deltaY;
        }
        break;
      case 'wheelDeltaX' in e:
        wheelDeltaX = e.wheelDeltaX / 120 * speed;
        wheelDeltaY = e.wheelDeltaY / 120 * speed;
        break;
      case 'wheelDelta' in e:
        wheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * speed;
        break;
      case 'detail' in e:
        wheelDeltaX = wheelDeltaY = -e.detail / 3 * speed;
        break;
      default:
        return;
    }

    var direction = invert ? -1 : 1;
    wheelDeltaX *= direction;
    wheelDeltaY *= direction;

    if (!this.hasVerticalScroll) {
      wheelDeltaX = wheelDeltaY;
      wheelDeltaY = 0;
    }

    var newX = void 0;
    var newY = void 0;
    if (this.options.snap) {
      newX = this.currentPage.pageX;
      newY = this.currentPage.pageY;

      if (wheelDeltaX > 0) {
        newX--;
      } else if (wheelDeltaX < 0) {
        newX++;
      }

      if (wheelDeltaY > 0) {
        newY--;
      } else if (wheelDeltaY < 0) {
        newY++;
      }

      this._goToPage(newX, newY);
      return;
    }

    newX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);
    newY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);

    this.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;
    this.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;

    if (newX > 0) {
      newX = 0;
    } else if (newX < this.maxScrollX) {
      newX = this.maxScrollX;
    }

    if (newY > 0) {
      newY = 0;
    } else if (newY < this.maxScrollY) {
      newY = this.maxScrollY;
    }

    this.scrollTo(newX, newY);
    this.trigger('scroll', {
      x: this.x,
      y: this.y
    });
  };
}

D
dolymood 已提交
3495 3496 3497
function BScroll(el, options) {
  this.wrapper = typeof el === 'string' ? document.querySelector(el) : el;
  if (!this.wrapper) {
A
AmyFoxFN 已提交
3498
    warn('Can not resolve the wrapper DOM.');
D
dolymood 已提交
3499 3500 3501
  }
  this.scroller = this.wrapper.children[0];
  if (!this.scroller) {
A
AmyFoxFN 已提交
3502
    warn('The wrapper need at least one child element to be scroller.');
D
dolymood 已提交
3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517
  }
  // cache style for better performance
  this.scrollerStyle = this.scroller.style;

  this._init(el, options);
}

initMixin(BScroll);
coreMixin(BScroll);
eventMixin(BScroll);
snapMixin(BScroll);
wheelMixin(BScroll);
scrollbarMixin(BScroll);
pullDownMixin(BScroll);
pullUpMixin(BScroll);
A
update  
AmyFoxFN 已提交
3518
mouseWheelMixin(BScroll);
D
dolymood 已提交
3519

A
AmyFoxFN 已提交
3520
BScroll.Version = '1.9.1';
D
dolymood 已提交
3521

D
dolymood 已提交
3522
/* harmony default export */ __webpack_exports__["default"] = (BScroll);
D
dolymood 已提交
3523 3524 3525 3526 3527 3528


/***/ }),
/* 55 */
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
3529 3530
var toInteger = __webpack_require__(14);
var defined = __webpack_require__(13);
D
dolymood 已提交
3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548
// true  -> String#at
// false -> String#codePointAt
module.exports = function (TO_STRING) {
  return function (that, pos) {
    var s = String(defined(that));
    var i = toInteger(pos);
    var l = s.length;
    var a, b;
    if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
    a = s.charCodeAt(i);
    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
      ? TO_STRING ? s.charAt(i) : a
      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  };
};


/***/ }),
A
AmyFoxFN 已提交
3549
/* 56 */
D
dolymood 已提交
3550 3551 3552 3553
/***/ (function(module, exports, __webpack_require__) {

"use strict";

A
AmyFoxFN 已提交
3554
var create = __webpack_require__(48);
A
AmyFoxFN 已提交
3555
var descriptor = __webpack_require__(15);
A
AmyFoxFN 已提交
3556
var setToStringTag = __webpack_require__(35);
D
dolymood 已提交
3557 3558 3559
var IteratorPrototype = {};

// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
A
AmyFoxFN 已提交
3560
__webpack_require__(6)(IteratorPrototype, __webpack_require__(2)('iterator'), function () { return this; });
D
dolymood 已提交
3561 3562 3563 3564 3565 3566 3567 3568

module.exports = function (Constructor, NAME, next) {
  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
  setToStringTag(Constructor, NAME + ' Iterator');
};


/***/ }),
A
AmyFoxFN 已提交
3569
/* 57 */
D
dolymood 已提交
3570 3571
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
3572
var dP = __webpack_require__(7);
A
AmyFoxFN 已提交
3573
var anObject = __webpack_require__(8);
A
AmyFoxFN 已提交
3574
var getKeys = __webpack_require__(18);
D
dolymood 已提交
3575

A
AmyFoxFN 已提交
3576
module.exports = __webpack_require__(4) ? Object.defineProperties : function defineProperties(O, Properties) {
D
dolymood 已提交
3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587
  anObject(O);
  var keys = getKeys(Properties);
  var length = keys.length;
  var i = 0;
  var P;
  while (length > i) dP.f(O, P = keys[i++], Properties[P]);
  return O;
};


/***/ }),
A
AmyFoxFN 已提交
3588
/* 58 */
D
dolymood 已提交
3589 3590 3591
/***/ (function(module, exports, __webpack_require__) {

// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
A
AmyFoxFN 已提交
3592
var has = __webpack_require__(10);
A
AmyFoxFN 已提交
3593
var toObject = __webpack_require__(17);
D
dolymood 已提交
3594
var IE_PROTO = __webpack_require__(16)('IE_PROTO');
D
dolymood 已提交
3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605
var ObjectProto = Object.prototype;

module.exports = Object.getPrototypeOf || function (O) {
  O = toObject(O);
  if (has(O, IE_PROTO)) return O[IE_PROTO];
  if (typeof O.constructor == 'function' && O instanceof O.constructor) {
    return O.constructor.prototype;
  } return O instanceof Object ? ObjectProto : null;
};


A
AmyFoxFN 已提交
3606
/***/ }),
A
AmyFoxFN 已提交
3607
/* 59 */
A
AmyFoxFN 已提交
3608 3609 3610
/***/ (function(module, exports, __webpack_require__) {

// getting tag from 19.1.3.6 Object.prototype.toString()
A
AmyFoxFN 已提交
3611 3612
var cof = __webpack_require__(19);
var TAG = __webpack_require__(2)('toStringTag');
A
AmyFoxFN 已提交
3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634
// ES3 wrong here
var ARG = cof(function () { return arguments; }()) == 'Arguments';

// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
  try {
    return it[key];
  } catch (e) { /* empty */ }
};

module.exports = function (it) {
  var O, T, B;
  return it === undefined ? 'Undefined' : it === null ? 'Null'
    // @@toStringTag case
    : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
    // builtinTag case
    : ARG ? cof(O)
    // ES3 arguments fallback
    : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
};


D
dolymood 已提交
3635
/***/ }),
A
AmyFoxFN 已提交
3636 3637 3638 3639
/* 60 */,
/* 61 */,
/* 62 */,
/* 63 */,
D
dolymood 已提交
3640
/* 64 */
D
dolymood 已提交
3641 3642 3643
/***/ (function(module, exports, __webpack_require__) {

// call something on iterator step with safe closing on error
A
AmyFoxFN 已提交
3644
var anObject = __webpack_require__(8);
D
dolymood 已提交
3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657
module.exports = function (iterator, fn, value, entries) {
  try {
    return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  // 7.4.6 IteratorClose(iterator, completion)
  } catch (e) {
    var ret = iterator['return'];
    if (ret !== undefined) anObject(ret.call(iterator));
    throw e;
  }
};


/***/ }),
D
dolymood 已提交
3658
/* 65 */
D
dolymood 已提交
3659 3660 3661
/***/ (function(module, exports, __webpack_require__) {

// check on default Array iterator
A
AmyFoxFN 已提交
3662 3663
var Iterators = __webpack_require__(22);
var ITERATOR = __webpack_require__(2)('iterator');
D
dolymood 已提交
3664 3665 3666 3667 3668 3669 3670 3671
var ArrayProto = Array.prototype;

module.exports = function (it) {
  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
};


/***/ }),
D
dolymood 已提交
3672
/* 66 */
D
dolymood 已提交
3673 3674
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
3675 3676 3677
var classof = __webpack_require__(59);
var ITERATOR = __webpack_require__(2)('iterator');
var Iterators = __webpack_require__(22);
D
dolymood 已提交
3678
module.exports = __webpack_require__(3).getIteratorMethod = function (it) {
D
dolymood 已提交
3679 3680 3681 3682 3683 3684 3685
  if (it != undefined) return it[ITERATOR]
    || it['@@iterator']
    || Iterators[classof(it)];
};


/***/ }),
D
dolymood 已提交
3686
/* 67 */
D
dolymood 已提交
3687 3688
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
3689
var ITERATOR = __webpack_require__(2)('iterator');
D
dolymood 已提交
3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713
var SAFE_CLOSING = false;

try {
  var riter = [7][ITERATOR]();
  riter['return'] = function () { SAFE_CLOSING = true; };
  // eslint-disable-next-line no-throw-literal
  Array.from(riter, function () { throw 2; });
} catch (e) { /* empty */ }

module.exports = function (exec, skipClosing) {
  if (!skipClosing && !SAFE_CLOSING) return false;
  var safe = false;
  try {
    var arr = [7];
    var iter = arr[ITERATOR]();
    iter.next = function () { return { done: safe = true }; };
    arr[ITERATOR] = function () { return iter; };
    exec(arr);
  } catch (e) { /* empty */ }
  return safe;
};


/***/ }),
A
AmyFoxFN 已提交
3714 3715
/* 68 */,
/* 69 */,
A
AmyFoxFN 已提交
3716
/* 70 */,
A
AmyFoxFN 已提交
3717 3718 3719 3720 3721 3722
/* 71 */,
/* 72 */,
/* 73 */,
/* 74 */,
/* 75 */,
/* 76 */,
A
AmyFoxFN 已提交
3723
/* 77 */
A
AmyFoxFN 已提交
3724 3725 3726 3727
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
A
AmyFoxFN 已提交
3728
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
A
AmyFoxFN 已提交
3729 3730 3731 3732
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
A
AmyFoxFN 已提交
3733
    factory(exports);
A
AmyFoxFN 已提交
3734 3735 3736 3737
  } else {
    var mod = {
      exports: {}
    };
A
AmyFoxFN 已提交
3738 3739
    factory(mod.exports);
    global.env = mod.exports;
A
AmyFoxFN 已提交
3740
  }
A
AmyFoxFN 已提交
3741
})(this, function (exports) {
A
AmyFoxFN 已提交
3742 3743 3744 3745 3746
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
A
AmyFoxFN 已提交
3747
  var inBrowser = exports.inBrowser = typeof window !== 'undefined';
A
AmyFoxFN 已提交
3748 3749 3750
});

/***/ }),
A
AmyFoxFN 已提交
3751 3752 3753 3754 3755
/* 78 */,
/* 79 */,
/* 80 */,
/* 81 */,
/* 82 */
A
AmyFoxFN 已提交
3756 3757 3758 3759 3760
/***/ (function(module, exports) {



/***/ }),
A
AmyFoxFN 已提交
3761
/* 83 */
A
AmyFoxFN 已提交
3762 3763
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
3764
__webpack_require__(84);
A
AmyFoxFN 已提交
3765
var global = __webpack_require__(0);
A
AmyFoxFN 已提交
3766 3767 3768
var hide = __webpack_require__(6);
var Iterators = __webpack_require__(22);
var TO_STRING_TAG = __webpack_require__(2)('toStringTag');
A
AmyFoxFN 已提交
3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785

var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
  'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
  'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
  'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
  'TextTrackList,TouchList').split(',');

for (var i = 0; i < DOMIterables.length; i++) {
  var NAME = DOMIterables[i];
  var Collection = global[NAME];
  var proto = Collection && Collection.prototype;
  if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
  Iterators[NAME] = Iterators.Array;
}


/***/ }),
A
AmyFoxFN 已提交
3786
/* 84 */
A
AmyFoxFN 已提交
3787 3788 3789 3790
/***/ (function(module, exports, __webpack_require__) {

"use strict";

A
AmyFoxFN 已提交
3791 3792 3793 3794
var addToUnscopables = __webpack_require__(85);
var step = __webpack_require__(86);
var Iterators = __webpack_require__(22);
var toIObject = __webpack_require__(12);
A
AmyFoxFN 已提交
3795 3796 3797 3798 3799

// 22.1.3.4 Array.prototype.entries()
// 22.1.3.13 Array.prototype.keys()
// 22.1.3.29 Array.prototype.values()
// 22.1.3.30 Array.prototype[@@iterator]()
A
AmyFoxFN 已提交
3800
module.exports = __webpack_require__(45)(Array, 'Array', function (iterated, kind) {
A
AmyFoxFN 已提交
3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825
  this._t = toIObject(iterated); // target
  this._i = 0;                   // next index
  this._k = kind;                // kind
// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
}, function () {
  var O = this._t;
  var kind = this._k;
  var index = this._i++;
  if (!O || index >= O.length) {
    this._t = undefined;
    return step(1);
  }
  if (kind == 'keys') return step(0, index);
  if (kind == 'values') return step(0, O[index]);
  return step(0, [index, O[index]]);
}, 'values');

// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
Iterators.Arguments = Iterators.Array;

addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');


A
AmyFoxFN 已提交
3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950
/***/ }),
/* 85 */
/***/ (function(module, exports) {

module.exports = function () { /* empty */ };


/***/ }),
/* 86 */
/***/ (function(module, exports) {

module.exports = function (done, value) {
  return { value: value, done: !!done };
};


/***/ }),
/* 87 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// 25.4.1.5 NewPromiseCapability(C)
var aFunction = __webpack_require__(28);

function PromiseCapability(C) {
  var resolve, reject;
  this.promise = new C(function ($$resolve, $$reject) {
    if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
    resolve = $$resolve;
    reject = $$reject;
  });
  this.resolve = aFunction(resolve);
  this.reject = aFunction(reject);
}

module.exports.f = function (C) {
  return new PromiseCapability(C);
};


/***/ }),
/* 88 */,
/* 89 */,
/* 90 */,
/* 91 */
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(77)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(exports, require('./env'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod.exports, global.env);
    global.dom = mod.exports;
  }
})(this, function (exports, _env) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.hasClass = hasClass;
  exports.addClass = addClass;
  exports.removeClass = removeClass;
  exports.getData = getData;
  exports.getRect = getRect;
  exports.prefixStyle = prefixStyle;
  function hasClass(el, className) {
    var reg = new RegExp('(^|\\s)' + className + '(\\s|$)');
    return reg.test(el.className);
  }

  function addClass(el, className) {
    if (hasClass(el, className)) {
      return;
    }

    var newClass = el.className.split(' ');
    newClass.push(className);
    el.className = newClass.join(' ');
  }

  function removeClass(el, className) {
    if (!hasClass(el, className)) {
      return;
    }

    var reg = new RegExp('(^|\\s)' + className + '(\\s|$)', 'g');
    el.className = el.className.replace(reg, ' ');
  }

  function getData(el, name) {
    var prefix = 'data-';
    return el.getAttribute(prefix + name);
  }

  function getRect(el) {
    return {
      top: el.offsetTop,
      left: el.offsetLeft,
      width: el.offsetWidth,
      height: el.offsetHeight
    };
  }

  var vendor = function () {
    if (!_env.inBrowser) {
      return false;
    }
    var elementStyle = document.createElement('div').style;
    var transformNames = {
      standard: 'transform',
      webkit: 'webkitTransform',
      Moz: 'MozTransform',
      O: 'OTransform',
      ms: 'msTransform'
    };
A
AmyFoxFN 已提交
3951

A
AmyFoxFN 已提交
3952 3953 3954 3955 3956
    for (var key in transformNames) {
      if (elementStyle[transformNames[key]] !== undefined) {
        return key;
      }
    }
D
dolymood 已提交
3957

A
AmyFoxFN 已提交
3958 3959
    return false;
  }();
D
dolymood 已提交
3960

A
AmyFoxFN 已提交
3961 3962 3963 3964
  function prefixStyle(style) {
    if (vendor === false) {
      return false;
    }
A
AmyFoxFN 已提交
3965

A
AmyFoxFN 已提交
3966 3967 3968 3969 3970 3971
    if (vendor === 'standard') {
      if (style === 'transitionEnd') {
        return 'transitionend';
      }
      return style;
    }
A
AmyFoxFN 已提交
3972

A
AmyFoxFN 已提交
3973 3974 3975
    return vendor + style.charAt(0).toUpperCase() + style.substr(1);
  }
});
A
AmyFoxFN 已提交
3976 3977

/***/ }),
A
AmyFoxFN 已提交
3978
/* 92 */
D
dolymood 已提交
3979 3980
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
3981 3982
function injectStyle (ssrContext) {
  __webpack_require__(95)
D
dolymood 已提交
3983
}
A
AmyFoxFN 已提交
3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995
var Component = __webpack_require__(1)(
  /* script */
  __webpack_require__(96),
  /* template */
  __webpack_require__(97),
  /* styles */
  injectStyle,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)
D
dolymood 已提交
3996

A
AmyFoxFN 已提交
3997
module.exports = Component.exports
D
dolymood 已提交
3998 3999 4000


/***/ }),
A
AmyFoxFN 已提交
4001 4002 4003
/* 93 */,
/* 94 */,
/* 95 */
D
dolymood 已提交
4004 4005 4006 4007 4008
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
A
AmyFoxFN 已提交
4009
/* 96 */
D
dolymood 已提交
4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports);
    global.loading = mod.exports;
  }
})(this, function (module, exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });


  var COMPONENT_NAME = 'cube-loading';

  exports.default = {
    name: COMPONENT_NAME,
D
dolymood 已提交
4039 4040 4041 4042 4043 4044
    data: function data() {
      return {
        balde: 12
      };
    },

D
dolymood 已提交
4045 4046
    props: {
      size: {
D
dolymood 已提交
4047
        type: Number
D
dolymood 已提交
4048 4049 4050 4051
      }
    },
    computed: {
      style: function style() {
D
dolymood 已提交
4052 4053 4054
        if (!this.size) {
          return;
        }
D
dolymood 已提交
4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066
        var value = this.size + 'px';
        return {
          width: value,
          height: value
        };
      }
    }
  };
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
4067
/* 97 */
D
dolymood 已提交
4068
/***/ (function(module, exports) {
D
dolymood 已提交
4069 4070 4071 4072

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    staticClass: "cube-loading"
D
dolymood 已提交
4073 4074 4075 4076 4077 4078 4079 4080
  }, [_c('span', {
    staticClass: "cube-loading-spinners",
    style: (_vm.style)
  }, _vm._l((_vm.balde), function(item) {
    return _c('i', {
      staticClass: "cube-loading-spinner"
    })
  }))])
D
dolymood 已提交
4081 4082 4083
},staticRenderFns: []}

/***/ }),
A
AmyFoxFN 已提交
4084
/* 98 */
D
dolymood 已提交
4085 4086
/***/ (function(module, exports, __webpack_require__) {

D
dolymood 已提交
4087
// 7.3.20 SpeciesConstructor(O, defaultConstructor)
A
AmyFoxFN 已提交
4088
var anObject = __webpack_require__(8);
A
AmyFoxFN 已提交
4089 4090
var aFunction = __webpack_require__(28);
var SPECIES = __webpack_require__(2)('species');
D
dolymood 已提交
4091 4092 4093 4094 4095 4096 4097 4098
module.exports = function (O, D) {
  var C = anObject(O).constructor;
  var S;
  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
};


/***/ }),
A
AmyFoxFN 已提交
4099
/* 99 */
D
dolymood 已提交
4100 4101
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
4102 4103 4104 4105
var ctx = __webpack_require__(21);
var invoke = __webpack_require__(127);
var html = __webpack_require__(49);
var cel = __webpack_require__(24);
D
dolymood 已提交
4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144
var global = __webpack_require__(0);
var process = global.process;
var setTask = global.setImmediate;
var clearTask = global.clearImmediate;
var MessageChannel = global.MessageChannel;
var Dispatch = global.Dispatch;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var defer, channel, port;
var run = function () {
  var id = +this;
  // eslint-disable-next-line no-prototype-builtins
  if (queue.hasOwnProperty(id)) {
    var fn = queue[id];
    delete queue[id];
    fn();
  }
};
var listener = function (event) {
  run.call(event.data);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!setTask || !clearTask) {
  setTask = function setImmediate(fn) {
    var args = [];
    var i = 1;
    while (arguments.length > i) args.push(arguments[i++]);
    queue[++counter] = function () {
      // eslint-disable-next-line no-new-func
      invoke(typeof fn == 'function' ? fn : Function(fn), args);
    };
    defer(counter);
    return counter;
  };
  clearTask = function clearImmediate(id) {
    delete queue[id];
  };
  // Node.js 0.8-
A
AmyFoxFN 已提交
4145
  if (__webpack_require__(19)(process) == 'process') {
D
dolymood 已提交
4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188
    defer = function (id) {
      process.nextTick(ctx(run, id, 1));
    };
  // Sphere (JS game engine) Dispatch API
  } else if (Dispatch && Dispatch.now) {
    defer = function (id) {
      Dispatch.now(ctx(run, id, 1));
    };
  // Browsers with MessageChannel, includes WebWorkers
  } else if (MessageChannel) {
    channel = new MessageChannel();
    port = channel.port2;
    channel.port1.onmessage = listener;
    defer = ctx(port.postMessage, port, 1);
  // Browsers with postMessage, skip WebWorkers
  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
  } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
    defer = function (id) {
      global.postMessage(id + '', '*');
    };
    global.addEventListener('message', listener, false);
  // IE8-
  } else if (ONREADYSTATECHANGE in cel('script')) {
    defer = function (id) {
      html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
        html.removeChild(this);
        run.call(id);
      };
    };
  // Rest old browsers
  } else {
    defer = function (id) {
      setTimeout(ctx(run, id, 1), 0);
    };
  }
}
module.exports = {
  set: setTask,
  clear: clearTask
};


/***/ }),
A
AmyFoxFN 已提交
4189
/* 100 */
D
dolymood 已提交
4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201
/***/ (function(module, exports) {

module.exports = function (exec) {
  try {
    return { e: false, v: exec() };
  } catch (e) {
    return { e: true, v: e };
  }
};


/***/ }),
A
AmyFoxFN 已提交
4202
/* 101 */
D
dolymood 已提交
4203 4204
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
4205 4206
var anObject = __webpack_require__(8);
var isObject = __webpack_require__(5);
A
AmyFoxFN 已提交
4207
var newPromiseCapability = __webpack_require__(87);
D
dolymood 已提交
4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219

module.exports = function (C, x) {
  anObject(C);
  if (isObject(x) && x.constructor === C) return x;
  var promiseCapability = newPromiseCapability.f(C);
  var resolve = promiseCapability.resolve;
  resolve(x);
  return promiseCapability.promise;
};


/***/ }),
A
AmyFoxFN 已提交
4220 4221
/* 102 */,
/* 103 */,
A
AmyFoxFN 已提交
4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237
/* 104 */,
/* 105 */,
/* 106 */,
/* 107 */,
/* 108 */,
/* 109 */,
/* 110 */,
/* 111 */,
/* 112 */,
/* 113 */,
/* 114 */,
/* 115 */,
/* 116 */,
/* 117 */,
/* 118 */,
/* 119 */
D
dolymood 已提交
4238 4239 4240
/***/ (function(module, exports, __webpack_require__) {

function injectStyle (ssrContext) {
A
AmyFoxFN 已提交
4241
  __webpack_require__(120)
D
dolymood 已提交
4242
}
A
AmyFoxFN 已提交
4243
var Component = __webpack_require__(1)(
D
dolymood 已提交
4244
  /* script */
A
AmyFoxFN 已提交
4245
  __webpack_require__(121),
A
AmyFoxFN 已提交
4246 4247
  /* template */
  __webpack_require__(136),
D
dolymood 已提交
4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259
  /* styles */
  injectStyle,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),
A
AmyFoxFN 已提交
4260
/* 120 */
D
dolymood 已提交
4261 4262 4263 4264 4265
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
A
AmyFoxFN 已提交
4266
/* 121 */
D
dolymood 已提交
4267 4268 4269 4270
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
A
AmyFoxFN 已提交
4271
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(122), __webpack_require__(29), __webpack_require__(54), __webpack_require__(92), __webpack_require__(133), __webpack_require__(91)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
D
dolymood 已提交
4272 4273 4274 4275
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
D
dolymood 已提交
4276
    factory(module, exports, require('babel-runtime/core-js/promise'), require('babel-runtime/core-js/object/assign'), require('better-scroll'), require('../loading/loading.vue'), require('../bubble/bubble.vue'), require('../../common/helpers/dom'));
D
dolymood 已提交
4277 4278 4279 4280
  } else {
    var mod = {
      exports: {}
    };
D
dolymood 已提交
4281
    factory(mod, mod.exports, global.promise, global.assign, global.betterScroll, global.loading, global.bubble, global.dom);
D
dolymood 已提交
4282 4283
    global.scroll = mod.exports;
  }
D
dolymood 已提交
4284
})(this, function (module, exports, _promise, _assign, _betterScroll, _loading, _bubble, _dom) {
D
dolymood 已提交
4285 4286 4287 4288 4289 4290 4291 4292
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _promise2 = _interopRequireDefault(_promise);

D
dolymood 已提交
4293 4294
  var _assign2 = _interopRequireDefault(_assign);

D
dolymood 已提交
4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310
  var _betterScroll2 = _interopRequireDefault(_betterScroll);

  var _loading2 = _interopRequireDefault(_loading);

  var _bubble2 = _interopRequireDefault(_bubble);

  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  var COMPONENT_NAME = 'cube-scroll';
  var DIRECTION_H = 'horizontal';
  var DIRECTION_V = 'vertical';
  var DEFAULT_REFRESH_TXT = 'Refresh success';
A
AmyFoxFN 已提交
4311
  var PULL_DOWN_ELEMENT_INITIAL_HEIGHT = -50;
D
dolymood 已提交
4312 4313 4314 4315 4316 4317 4318

  var EVENT_SCROLL = 'scroll';
  var EVENT_BEFORE_SCROLL_START = 'before-scroll-start';
  var EVENT_CLICK = 'click';
  var EVENT_PULLING_DOWN = 'pulling-down';
  var EVENT_PULLING_UP = 'pulling-up';

D
dolymood 已提交
4319 4320 4321 4322 4323 4324 4325 4326 4327
  var DEFAULT_OPTIONS = {
    observeDOM: true,
    click: true,
    probeType: 1,
    scrollbar: false,
    pullDownRefresh: false,
    pullUpLoad: false
  };

D
dolymood 已提交
4328 4329 4330 4331 4332 4333 4334 4335 4336
  exports.default = {
    name: COMPONENT_NAME,
    props: {
      data: {
        type: Array,
        default: function _default() {
          return [];
        }
      },
D
dolymood 已提交
4337 4338 4339 4340 4341
      options: {
        type: Object,
        default: function _default() {
          return {};
        }
D
dolymood 已提交
4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371
      },
      listenScroll: {
        type: Boolean,
        default: false
      },
      listenBeforeScroll: {
        type: Boolean,
        default: false
      },
      direction: {
        type: String,
        default: DIRECTION_V
      },
      refreshDelay: {
        type: Number,
        default: 20
      }
    },
    data: function data() {
      return {
        beforePullDown: true,
        isPullingDown: false,
        isPullUpLoad: false,
        pullUpDirty: true,
        bubbleY: 0,
        pullDownStyle: ''
      };
    },

    computed: {
D
dolymood 已提交
4372 4373 4374
      pullDownRefresh: function pullDownRefresh() {
        return this.options.pullDownRefresh;
      },
A
AmyFoxFN 已提交
4375 4376 4377
      pullUpLoad: function pullUpLoad() {
        return this.options.pullUpLoad;
      },
D
dolymood 已提交
4378
      pullUpTxt: function pullUpTxt() {
D
dolymood 已提交
4379 4380
        var pullUpLoad = this.pullUpLoad;
        var txt = pullUpLoad && pullUpLoad.txt;
A
AmyFoxFN 已提交
4381 4382
        var moreTxt = txt && txt.more || '';
        var noMoreTxt = txt && txt.noMore || '';
D
dolymood 已提交
4383 4384 4385 4386

        return this.pullUpDirty ? moreTxt : noMoreTxt;
      },
      refreshTxt: function refreshTxt() {
D
dolymood 已提交
4387 4388
        var pullDownRefresh = this.pullDownRefresh;
        return pullDownRefresh && pullDownRefresh.txt || DEFAULT_REFRESH_TXT;
D
dolymood 已提交
4389 4390
      }
    },
A
AmyFoxFN 已提交
4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443
    watch: {
      data: function data() {
        var _this = this;

        setTimeout(function () {
          _this.forceUpdate(true);
        }, this.refreshDelay);
      },

      pullDownRefresh: {
        handler: function handler(newVal, oldVal) {
          if (newVal) {
            this.scroll.openPullDown(newVal);
            if (!oldVal) {
              this._onPullDownRefresh();
              this._calculateMinHeight();
            }
          }

          if (!newVal && oldVal) {
            this.scroll.closePullDown();
            this._offPullDownRefresh();
            this._calculateMinHeight();
          }
        },

        deep: true
      },
      pullUpLoad: {
        handler: function handler(newVal, oldVal) {
          if (newVal) {
            this.scroll.openPullUp(newVal);
            if (!oldVal) {
              this._onPullUpLoad();
              this._calculateMinHeight();
            }
          }

          if (!newVal && oldVal) {
            this.scroll.closePullUp();
            this._offPullUpLoad();
            this._calculateMinHeight();
          }
        },

        deep: true
      }
    },
    activated: function activated() {
      this.enable();
    },
    deactivated: function deactivated() {
      this.disable();
D
dolymood 已提交
4444 4445
    },
    mounted: function mounted() {
A
AmyFoxFN 已提交
4446
      var _this2 = this;
D
dolymood 已提交
4447

D
dolymood 已提交
4448
      this.$nextTick(function () {
A
AmyFoxFN 已提交
4449
        _this2.initScroll();
D
dolymood 已提交
4450
      });
D
dolymood 已提交
4451
    },
A
AmyFoxFN 已提交
4452 4453 4454
    beforeDestroy: function beforeDestroy() {
      this.destroy();
    },
D
dolymood 已提交
4455 4456

    methods: {
D
dolymood 已提交
4457
      initScroll: function initScroll() {
A
AmyFoxFN 已提交
4458
        var _this3 = this;
D
dolymood 已提交
4459 4460 4461 4462

        if (!this.$refs.wrapper) {
          return;
        }
A
AmyFoxFN 已提交
4463
        this._calculateMinHeight();
D
dolymood 已提交
4464

D
dolymood 已提交
4465
        var options = (0, _assign2.default)({}, DEFAULT_OPTIONS, {
D
dolymood 已提交
4466
          scrollY: this.direction === DIRECTION_V,
D
dolymood 已提交
4467 4468
          scrollX: this.direction === DIRECTION_H
        }, this.options);
D
dolymood 已提交
4469 4470 4471 4472 4473

        this.scroll = new _betterScroll2.default(this.$refs.wrapper, options);

        if (this.listenScroll) {
          this.scroll.on('scroll', function (pos) {
A
AmyFoxFN 已提交
4474
            _this3.$emit(EVENT_SCROLL, pos);
D
dolymood 已提交
4475 4476 4477 4478 4479
          });
        }

        if (this.listenBeforeScroll) {
          this.scroll.on('beforeScrollStart', function () {
A
AmyFoxFN 已提交
4480
            _this3.$emit(EVENT_BEFORE_SCROLL_START);
D
dolymood 已提交
4481 4482 4483 4484
          });
        }

        if (this.pullDownRefresh) {
A
AmyFoxFN 已提交
4485
          this._onPullDownRefresh();
D
dolymood 已提交
4486 4487 4488
        }

        if (this.pullUpLoad) {
A
AmyFoxFN 已提交
4489
          this._onPullUpLoad();
D
dolymood 已提交
4490 4491 4492 4493 4494 4495 4496 4497 4498
        }
      },
      disable: function disable() {
        this.scroll && this.scroll.disable();
      },
      enable: function enable() {
        this.scroll && this.scroll.enable();
      },
      refresh: function refresh() {
A
AmyFoxFN 已提交
4499
        this._calculateMinHeight();
D
dolymood 已提交
4500 4501
        this.scroll && this.scroll.refresh();
      },
D
dolymood 已提交
4502
      destroy: function destroy() {
A
AmyFoxFN 已提交
4503 4504
        this.scroll && this.scroll.destroy();
        this.scroll = null;
D
dolymood 已提交
4505
      },
D
dolymood 已提交
4506 4507 4508 4509 4510 4511 4512 4513 4514
      scrollTo: function scrollTo() {
        this.scroll && this.scroll.scrollTo.apply(this.scroll, arguments);
      },
      scrollToElement: function scrollToElement() {
        this.scroll && this.scroll.scrollToElement.apply(this.scroll, arguments);
      },
      clickItem: function clickItem(item) {
        this.$emit(EVENT_CLICK, item);
      },
A
AmyFoxFN 已提交
4515 4516 4517 4518
      forceUpdate: function forceUpdate() {
        var _this4 = this;

        var dirty = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
D
dolymood 已提交
4519 4520 4521 4522

        if (this.pullDownRefresh && this.isPullingDown) {
          this.isPullingDown = false;
          this._reboundPullDown().then(function () {
A
AmyFoxFN 已提交
4523
            _this4._afterPullDown(dirty);
D
dolymood 已提交
4524 4525 4526 4527 4528
          });
        } else if (this.pullUpLoad && this.isPullUpLoad) {
          this.isPullUpLoad = false;
          this.scroll.finishPullUp();
          this.pullUpDirty = dirty;
A
AmyFoxFN 已提交
4529
          dirty && this.refresh();
D
dolymood 已提交
4530
        } else {
A
AmyFoxFN 已提交
4531
          dirty && this.refresh();
D
dolymood 已提交
4532 4533
        }
      },
A
AmyFoxFN 已提交
4534
      _calculateMinHeight: function _calculateMinHeight() {
A
AmyFoxFN 已提交
4535 4536
        if (this.$refs.listWrapper) {
          this.$refs.listWrapper.style.minHeight = this.pullDownRefresh || this.pullUpLoad ? (0, _dom.getRect)(this.$refs.wrapper).height + 1 + 'px' : 0;
A
AmyFoxFN 已提交
4537 4538
        }
      },
A
AmyFoxFN 已提交
4539 4540 4541
      _onPullDownRefresh: function _onPullDownRefresh() {
        this.scroll.on('pullingDown', this._pullDownHandle);
        this.scroll.on('scroll', this._pullDownScrollHandle);
D
dolymood 已提交
4542
      },
A
AmyFoxFN 已提交
4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569
      _offPullDownRefresh: function _offPullDownRefresh() {
        this.scroll.off('pullingDown', this._pullDownHandle);
        this.scroll.off('scroll', this._pullDownScrollHandle);
      },
      _pullDownHandle: function _pullDownHandle() {
        this.beforePullDown = false;
        this.isPullingDown = true;
        this.$emit(EVENT_PULLING_DOWN);
      },
      _pullDownScrollHandle: function _pullDownScrollHandle(pos) {
        if (this.beforePullDown) {
          this.bubbleY = Math.max(0, pos.y + PULL_DOWN_ELEMENT_INITIAL_HEIGHT);
          this.pullDownStyle = 'top:' + Math.min(pos.y + PULL_DOWN_ELEMENT_INITIAL_HEIGHT, 10) + 'px';
        } else {
          this.bubbleY = 0;
          this.pullDownStyle = 'top:' + Math.min(pos.y - 30, 10) + 'px';
        }
      },
      _onPullUpLoad: function _onPullUpLoad() {
        this.scroll.on('pullingUp', this._pullUpHandle);
      },
      _offPullUpLoad: function _offPullUpLoad() {
        this.scroll.off('pullingUp', this._pullUpHandle);
      },
      _pullUpHandle: function _pullUpHandle() {
        this.isPullUpLoad = true;
        this.$emit(EVENT_PULLING_UP);
D
dolymood 已提交
4570 4571
      },
      _reboundPullDown: function _reboundPullDown() {
A
AmyFoxFN 已提交
4572
        var _this5 = this;
D
dolymood 已提交
4573 4574 4575 4576 4577 4578

        var _pullDownRefresh$stop = this.pullDownRefresh.stopTime,
            stopTime = _pullDownRefresh$stop === undefined ? 600 : _pullDownRefresh$stop;

        return new _promise2.default(function (resolve) {
          setTimeout(function () {
A
AmyFoxFN 已提交
4579 4580
            _this5.scroll.finishPullDown();
            _this5.isPullingDown = false;
D
dolymood 已提交
4581 4582 4583 4584
            resolve();
          }, stopTime);
        });
      },
A
AmyFoxFN 已提交
4585
      _afterPullDown: function _afterPullDown(dirty) {
A
AmyFoxFN 已提交
4586
        var _this6 = this;
D
dolymood 已提交
4587 4588

        setTimeout(function () {
A
AmyFoxFN 已提交
4589 4590 4591
          _this6.pullDownStyle = 'top:' + PULL_DOWN_ELEMENT_INITIAL_HEIGHT + 'px';
          _this6.beforePullDown = true;
          dirty && _this6.refresh();
D
dolymood 已提交
4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603
        }, this.scroll.options.bounceTime);
      }
    },
    components: {
      Loading: _loading2.default,
      Bubble: _bubble2.default
    }
  };
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
4604
/* 122 */
D
dolymood 已提交
4605 4606
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
4607
module.exports = { "default": __webpack_require__(123), __esModule: true };
D
dolymood 已提交
4608 4609

/***/ }),
A
AmyFoxFN 已提交
4610
/* 123 */
D
dolymood 已提交
4611 4612
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
4613
__webpack_require__(82);
A
AmyFoxFN 已提交
4614 4615 4616 4617 4618
__webpack_require__(50);
__webpack_require__(83);
__webpack_require__(124);
__webpack_require__(131);
__webpack_require__(132);
D
dolymood 已提交
4619
module.exports = __webpack_require__(3).Promise;
D
dolymood 已提交
4620 4621 4622


/***/ }),
A
AmyFoxFN 已提交
4623
/* 124 */
D
dolymood 已提交
4624 4625 4626 4627
/***/ (function(module, exports, __webpack_require__) {

"use strict";

A
AmyFoxFN 已提交
4628
var LIBRARY = __webpack_require__(41);
D
dolymood 已提交
4629
var global = __webpack_require__(0);
A
AmyFoxFN 已提交
4630 4631 4632
var ctx = __webpack_require__(21);
var classof = __webpack_require__(59);
var $export = __webpack_require__(11);
A
AmyFoxFN 已提交
4633
var isObject = __webpack_require__(5);
A
AmyFoxFN 已提交
4634 4635 4636 4637 4638 4639 4640 4641 4642
var aFunction = __webpack_require__(28);
var anInstance = __webpack_require__(125);
var forOf = __webpack_require__(126);
var speciesConstructor = __webpack_require__(98);
var task = __webpack_require__(99).set;
var microtask = __webpack_require__(128)();
var newPromiseCapabilityModule = __webpack_require__(87);
var perform = __webpack_require__(100);
var promiseResolve = __webpack_require__(101);
D
dolymood 已提交
4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655
var PROMISE = 'Promise';
var TypeError = global.TypeError;
var process = global.process;
var $Promise = global[PROMISE];
var isNode = classof(process) == 'process';
var empty = function () { /* empty */ };
var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;

var USE_NATIVE = !!function () {
  try {
    // correct subclassing with @@species support
    var promise = $Promise.resolve(1);
A
AmyFoxFN 已提交
4656
    var FakePromise = (promise.constructor = {})[__webpack_require__(2)('species')] = function (exec) {
D
dolymood 已提交
4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732
      exec(empty, empty);
    };
    // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
    return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise;
  } catch (e) { /* empty */ }
}();

// helpers
var isThenable = function (it) {
  var then;
  return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
};
var notify = function (promise, isReject) {
  if (promise._n) return;
  promise._n = true;
  var chain = promise._c;
  microtask(function () {
    var value = promise._v;
    var ok = promise._s == 1;
    var i = 0;
    var run = function (reaction) {
      var handler = ok ? reaction.ok : reaction.fail;
      var resolve = reaction.resolve;
      var reject = reaction.reject;
      var domain = reaction.domain;
      var result, then;
      try {
        if (handler) {
          if (!ok) {
            if (promise._h == 2) onHandleUnhandled(promise);
            promise._h = 1;
          }
          if (handler === true) result = value;
          else {
            if (domain) domain.enter();
            result = handler(value);
            if (domain) domain.exit();
          }
          if (result === reaction.promise) {
            reject(TypeError('Promise-chain cycle'));
          } else if (then = isThenable(result)) {
            then.call(result, resolve, reject);
          } else resolve(result);
        } else reject(value);
      } catch (e) {
        reject(e);
      }
    };
    while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
    promise._c = [];
    promise._n = false;
    if (isReject && !promise._h) onUnhandled(promise);
  });
};
var onUnhandled = function (promise) {
  task.call(global, function () {
    var value = promise._v;
    var unhandled = isUnhandled(promise);
    var result, handler, console;
    if (unhandled) {
      result = perform(function () {
        if (isNode) {
          process.emit('unhandledRejection', value, promise);
        } else if (handler = global.onunhandledrejection) {
          handler({ promise: promise, reason: value });
        } else if ((console = global.console) && console.error) {
          console.error('Unhandled promise rejection', value);
        }
      });
      // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
      promise._h = isNode || isUnhandled(promise) ? 2 : 1;
    } promise._a = undefined;
    if (unhandled && result.e) throw result.v;
  });
};
var isUnhandled = function (promise) {
A
AmyFoxFN 已提交
4733
  return promise._h !== 1 && (promise._a || promise._c).length === 0;
D
dolymood 已提交
4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804
};
var onHandleUnhandled = function (promise) {
  task.call(global, function () {
    var handler;
    if (isNode) {
      process.emit('rejectionHandled', promise);
    } else if (handler = global.onrejectionhandled) {
      handler({ promise: promise, reason: promise._v });
    }
  });
};
var $reject = function (value) {
  var promise = this;
  if (promise._d) return;
  promise._d = true;
  promise = promise._w || promise; // unwrap
  promise._v = value;
  promise._s = 2;
  if (!promise._a) promise._a = promise._c.slice();
  notify(promise, true);
};
var $resolve = function (value) {
  var promise = this;
  var then;
  if (promise._d) return;
  promise._d = true;
  promise = promise._w || promise; // unwrap
  try {
    if (promise === value) throw TypeError("Promise can't be resolved itself");
    if (then = isThenable(value)) {
      microtask(function () {
        var wrapper = { _w: promise, _d: false }; // wrap
        try {
          then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
        } catch (e) {
          $reject.call(wrapper, e);
        }
      });
    } else {
      promise._v = value;
      promise._s = 1;
      notify(promise, false);
    }
  } catch (e) {
    $reject.call({ _w: promise, _d: false }, e); // wrap
  }
};

// constructor polyfill
if (!USE_NATIVE) {
  // 25.4.3.1 Promise(executor)
  $Promise = function Promise(executor) {
    anInstance(this, $Promise, PROMISE, '_h');
    aFunction(executor);
    Internal.call(this);
    try {
      executor(ctx($resolve, this, 1), ctx($reject, this, 1));
    } catch (err) {
      $reject.call(this, err);
    }
  };
  // eslint-disable-next-line no-unused-vars
  Internal = function Promise(executor) {
    this._c = [];             // <- awaiting reactions
    this._a = undefined;      // <- checked in isUnhandled reactions
    this._s = 0;              // <- state
    this._d = false;          // <- done
    this._v = undefined;      // <- value
    this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
    this._n = false;          // <- notify
  };
A
AmyFoxFN 已提交
4805
  Internal.prototype = __webpack_require__(129)($Promise.prototype, {
D
dolymood 已提交
4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835
    // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
    then: function then(onFulfilled, onRejected) {
      var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
      reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
      reaction.fail = typeof onRejected == 'function' && onRejected;
      reaction.domain = isNode ? process.domain : undefined;
      this._c.push(reaction);
      if (this._a) this._a.push(reaction);
      if (this._s) notify(this, false);
      return reaction.promise;
    },
    // 25.4.5.1 Promise.prototype.catch(onRejected)
    'catch': function (onRejected) {
      return this.then(undefined, onRejected);
    }
  });
  OwnPromiseCapability = function () {
    var promise = new Internal();
    this.promise = promise;
    this.resolve = ctx($resolve, promise, 1);
    this.reject = ctx($reject, promise, 1);
  };
  newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
    return C === $Promise || C === Wrapper
      ? new OwnPromiseCapability(C)
      : newGenericPromiseCapability(C);
  };
}

$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
A
AmyFoxFN 已提交
4836 4837
__webpack_require__(35)($Promise, PROMISE);
__webpack_require__(130)(PROMISE);
D
dolymood 已提交
4838
Wrapper = __webpack_require__(3)[PROMISE];
D
dolymood 已提交
4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855

// statics
$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
  // 25.4.4.5 Promise.reject(r)
  reject: function reject(r) {
    var capability = newPromiseCapability(this);
    var $$reject = capability.reject;
    $$reject(r);
    return capability.promise;
  }
});
$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
  // 25.4.4.6 Promise.resolve(x)
  resolve: function resolve(x) {
    return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
  }
});
D
dolymood 已提交
4856
$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(67)(function (iter) {
D
dolymood 已提交
4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902
  $Promise.all(iter)['catch'](empty);
})), PROMISE, {
  // 25.4.4.1 Promise.all(iterable)
  all: function all(iterable) {
    var C = this;
    var capability = newPromiseCapability(C);
    var resolve = capability.resolve;
    var reject = capability.reject;
    var result = perform(function () {
      var values = [];
      var index = 0;
      var remaining = 1;
      forOf(iterable, false, function (promise) {
        var $index = index++;
        var alreadyCalled = false;
        values.push(undefined);
        remaining++;
        C.resolve(promise).then(function (value) {
          if (alreadyCalled) return;
          alreadyCalled = true;
          values[$index] = value;
          --remaining || resolve(values);
        }, reject);
      });
      --remaining || resolve(values);
    });
    if (result.e) reject(result.v);
    return capability.promise;
  },
  // 25.4.4.4 Promise.race(iterable)
  race: function race(iterable) {
    var C = this;
    var capability = newPromiseCapability(C);
    var reject = capability.reject;
    var result = perform(function () {
      forOf(iterable, false, function (promise) {
        C.resolve(promise).then(capability.resolve, reject);
      });
    });
    if (result.e) reject(result.v);
    return capability.promise;
  }
});


/***/ }),
A
AmyFoxFN 已提交
4903
/* 125 */
D
dolymood 已提交
4904 4905 4906 4907 4908 4909 4910 4911 4912 4913
/***/ (function(module, exports) {

module.exports = function (it, Constructor, name, forbiddenField) {
  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
    throw TypeError(name + ': incorrect invocation!');
  } return it;
};


/***/ }),
A
AmyFoxFN 已提交
4914
/* 126 */
D
dolymood 已提交
4915 4916
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
4917
var ctx = __webpack_require__(21);
D
dolymood 已提交
4918 4919
var call = __webpack_require__(64);
var isArrayIter = __webpack_require__(65);
A
AmyFoxFN 已提交
4920 4921
var anObject = __webpack_require__(8);
var toLength = __webpack_require__(27);
D
dolymood 已提交
4922
var getIterFn = __webpack_require__(66);
D
dolymood 已提交
4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944
var BREAK = {};
var RETURN = {};
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
  var f = ctx(fn, that, entries ? 2 : 1);
  var index = 0;
  var length, step, iterator, result;
  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
  // fast case for arrays with default iterator
  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
    if (result === BREAK || result === RETURN) return result;
  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
    result = call(iterator, f, step.value, entries);
    if (result === BREAK || result === RETURN) return result;
  }
};
exports.BREAK = BREAK;
exports.RETURN = RETURN;


/***/ }),
A
AmyFoxFN 已提交
4945
/* 127 */
D
dolymood 已提交
4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966
/***/ (function(module, exports) {

// fast apply, http://jsperf.lnkit.com/fast-apply/5
module.exports = function (fn, args, that) {
  var un = that === undefined;
  switch (args.length) {
    case 0: return un ? fn()
                      : fn.call(that);
    case 1: return un ? fn(args[0])
                      : fn.call(that, args[0]);
    case 2: return un ? fn(args[0], args[1])
                      : fn.call(that, args[0], args[1]);
    case 3: return un ? fn(args[0], args[1], args[2])
                      : fn.call(that, args[0], args[1], args[2]);
    case 4: return un ? fn(args[0], args[1], args[2], args[3])
                      : fn.call(that, args[0], args[1], args[2], args[3]);
  } return fn.apply(that, args);
};


/***/ }),
A
AmyFoxFN 已提交
4967
/* 128 */
D
dolymood 已提交
4968 4969 4970
/***/ (function(module, exports, __webpack_require__) {

var global = __webpack_require__(0);
A
AmyFoxFN 已提交
4971
var macrotask = __webpack_require__(99).set;
D
dolymood 已提交
4972 4973 4974
var Observer = global.MutationObserver || global.WebKitMutationObserver;
var process = global.process;
var Promise = global.Promise;
A
AmyFoxFN 已提交
4975
var isNode = __webpack_require__(19)(process) == 'process';
D
dolymood 已提交
4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001

module.exports = function () {
  var head, last, notify;

  var flush = function () {
    var parent, fn;
    if (isNode && (parent = process.domain)) parent.exit();
    while (head) {
      fn = head.fn;
      head = head.next;
      try {
        fn();
      } catch (e) {
        if (head) notify();
        else last = undefined;
        throw e;
      }
    } last = undefined;
    if (parent) parent.enter();
  };

  // Node.js
  if (isNode) {
    notify = function () {
      process.nextTick(flush);
    };
A
AmyFoxFN 已提交
5002 5003
  // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
  } else if (Observer && !(global.navigator && global.navigator.standalone)) {
D
dolymood 已提交
5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040
    var toggle = true;
    var node = document.createTextNode('');
    new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
    notify = function () {
      node.data = toggle = !toggle;
    };
  // environments with maybe non-completely correct, but existent Promise
  } else if (Promise && Promise.resolve) {
    var promise = Promise.resolve();
    notify = function () {
      promise.then(flush);
    };
  // for other environments - macrotask based on:
  // - setImmediate
  // - MessageChannel
  // - window.postMessag
  // - onreadystatechange
  // - setTimeout
  } else {
    notify = function () {
      // strange IE + webpack dev server bug - use .call(global)
      macrotask.call(global, flush);
    };
  }

  return function (fn) {
    var task = { fn: fn, next: undefined };
    if (last) last.next = task;
    if (!head) {
      head = task;
      notify();
    } last = task;
  };
};


/***/ }),
A
AmyFoxFN 已提交
5041
/* 129 */
D
dolymood 已提交
5042 5043
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
5044
var hide = __webpack_require__(6);
D
dolymood 已提交
5045 5046 5047 5048 5049 5050 5051 5052 5053
module.exports = function (target, src, safe) {
  for (var key in src) {
    if (safe && target[key]) target[key] = src[key];
    else hide(target, key, src[key]);
  } return target;
};


/***/ }),
A
AmyFoxFN 已提交
5054
/* 130 */
D
dolymood 已提交
5055 5056 5057 5058 5059
/***/ (function(module, exports, __webpack_require__) {

"use strict";

var global = __webpack_require__(0);
D
dolymood 已提交
5060
var core = __webpack_require__(3);
A
AmyFoxFN 已提交
5061 5062 5063
var dP = __webpack_require__(7);
var DESCRIPTORS = __webpack_require__(4);
var SPECIES = __webpack_require__(2)('species');
D
dolymood 已提交
5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074

module.exports = function (KEY) {
  var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
  if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
    configurable: true,
    get: function () { return this; }
  });
};


/***/ }),
A
AmyFoxFN 已提交
5075
/* 131 */
D
dolymood 已提交
5076 5077 5078 5079 5080
/***/ (function(module, exports, __webpack_require__) {

"use strict";
// https://github.com/tc39/proposal-promise-finally

A
AmyFoxFN 已提交
5081
var $export = __webpack_require__(11);
D
dolymood 已提交
5082
var core = __webpack_require__(3);
D
dolymood 已提交
5083
var global = __webpack_require__(0);
A
AmyFoxFN 已提交
5084 5085
var speciesConstructor = __webpack_require__(98);
var promiseResolve = __webpack_require__(101);
D
dolymood 已提交
5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101

$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
  var C = speciesConstructor(this, core.Promise || global.Promise);
  var isFunction = typeof onFinally == 'function';
  return this.then(
    isFunction ? function (x) {
      return promiseResolve(C, onFinally()).then(function () { return x; });
    } : onFinally,
    isFunction ? function (e) {
      return promiseResolve(C, onFinally()).then(function () { throw e; });
    } : onFinally
  );
} });


/***/ }),
A
AmyFoxFN 已提交
5102
/* 132 */
D
dolymood 已提交
5103 5104 5105 5106 5107
/***/ (function(module, exports, __webpack_require__) {

"use strict";

// https://github.com/tc39/proposal-promise-try
A
AmyFoxFN 已提交
5108 5109 5110
var $export = __webpack_require__(11);
var newPromiseCapability = __webpack_require__(87);
var perform = __webpack_require__(100);
D
dolymood 已提交
5111 5112 5113 5114 5115 5116 5117 5118 5119 5120

$export($export.S, 'Promise', { 'try': function (callbackfn) {
  var promiseCapability = newPromiseCapability.f(this);
  var result = perform(callbackfn);
  (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
  return promiseCapability.promise;
} });


/***/ }),
A
AmyFoxFN 已提交
5121
/* 133 */
D
dolymood 已提交
5122 5123
/***/ (function(module, exports, __webpack_require__) {

A
AmyFoxFN 已提交
5124
var Component = __webpack_require__(1)(
D
dolymood 已提交
5125
  /* script */
A
AmyFoxFN 已提交
5126
  __webpack_require__(134),
D
dolymood 已提交
5127
  /* template */
A
AmyFoxFN 已提交
5128
  __webpack_require__(135),
D
dolymood 已提交
5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140
  /* styles */
  null,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),
A
AmyFoxFN 已提交
5141
/* 134 */
D
dolymood 已提交
5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports);
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports);
    global.bubble = mod.exports;
  }
})(this, function (module, exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = {
    props: {
      y: {
        type: Number,
        default: 0
      }
    },
    data: function data() {
      return {
        width: 50,
        height: 80
      };
    },

    computed: {
      distance: function distance() {
        return Math.max(0, Math.min(this.y * this.ratio, this.maxDistance));
      },
      style: function style() {
        return 'width:' + this.width / this.ratio + 'px;height:' + this.height / this.ratio + 'px';
      }
    },
    created: function created() {
      this.ratio = window.devicePixelRatio;
      this.width *= this.ratio;
      this.height *= this.ratio;
      this.initRadius = 18 * this.ratio;
      this.minHeadRadius = 12 * this.ratio;
      this.minTailRadius = 5 * this.ratio;
      this.initArrowRadius = 10 * this.ratio;
      this.minArrowRadius = 6 * this.ratio;
      this.arrowWidth = 3 * this.ratio;
      this.maxDistance = 40 * this.ratio;
      this.initCenterX = 25 * this.ratio;
      this.initCenterY = 25 * this.ratio;
      this.headCenter = {
        x: this.initCenterX,
        y: this.initCenterY
      };
    },
    mounted: function mounted() {
      this._draw();
    },

    methods: {
      _draw: function _draw() {
        var bubble = this.$refs.bubble;
        var ctx = bubble.getContext('2d');
        ctx.clearRect(0, 0, bubble.width, bubble.height);

        this._drawBubble(ctx);

        this._drawArrow(ctx);
      },
      _drawBubble: function _drawBubble(ctx) {
        ctx.save();
        ctx.beginPath();

        var rate = this.distance / this.maxDistance;
        var headRadius = this.initRadius - (this.initRadius - this.minHeadRadius) * rate;

        this.headCenter.y = this.initCenterY - (this.initRadius - this.minHeadRadius) * rate;

        ctx.arc(this.headCenter.x, this.headCenter.y, headRadius, 0, Math.PI, true);

        var tailRadius = this.initRadius - (this.initRadius - this.minTailRadius) * rate;
        var tailCenter = {
          x: this.headCenter.x,
          y: this.headCenter.y + this.distance
        };

        var tailPointL = {
          x: tailCenter.x - tailRadius,
          y: tailCenter.y
        };
        var controlPointL = {
          x: tailPointL.x,
          y: tailPointL.y - this.distance / 2
        };

        ctx.quadraticCurveTo(controlPointL.x, controlPointL.y, tailPointL.x, tailPointL.y);

        ctx.arc(tailCenter.x, tailCenter.y, tailRadius, Math.PI, 0, true);

        var headPointR = {
          x: this.headCenter.x + headRadius,
          y: this.headCenter.y
        };
        var controlPointR = {
          x: tailCenter.x + tailRadius,
          y: headPointR.y + this.distance / 2
        };
        ctx.quadraticCurveTo(controlPointR.x, controlPointR.y, headPointR.x, headPointR.y);

        ctx.fillStyle = 'rgb(170,170,170)';
        ctx.fill();
        ctx.strokeStyle = 'rgb(153,153,153)';
        ctx.stroke();
        ctx.restore();
      },
      _drawArrow: function _drawArrow(ctx) {
        ctx.save();
        ctx.beginPath();

        var rate = this.distance / this.maxDistance;
        var arrowRadius = this.initArrowRadius - (this.initArrowRadius - this.minArrowRadius) * rate;

        ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius - (this.arrowWidth - rate), -Math.PI / 2, 0, true);

        ctx.arc(this.headCenter.x, this.headCenter.y, arrowRadius, 0, Math.PI * 3 / 2, false);

        ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius - this.arrowWidth / 2 + rate);
        ctx.lineTo(this.headCenter.x + this.arrowWidth * 2 - rate * 2, this.headCenter.y - arrowRadius + this.arrowWidth / 2);

        ctx.lineTo(this.headCenter.x, this.headCenter.y - arrowRadius + this.arrowWidth * 3 / 2 - rate);

        ctx.fillStyle = 'rgb(255,255,255)';
        ctx.fill();
        ctx.strokeStyle = 'rgb(170,170,170)';
        ctx.stroke();
        ctx.restore();
      }
    },
    watch: {
      y: function y() {
        this._draw();
      }
    }
  };
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
5298
/* 135 */
D
dolymood 已提交
5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('canvas', {
    ref: "bubble",
    style: (_vm.style),
    attrs: {
      "width": _vm.width,
      "height": _vm.height
    }
  })
},staticRenderFns: []}

/***/ }),
A
AmyFoxFN 已提交
5313
/* 136 */
D
dolymood 已提交
5314 5315 5316 5317 5318 5319 5320 5321
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    ref: "wrapper",
    staticClass: "cube-scroll-wrapper"
  }, [_c('div', {
    staticClass: "cube-scroll-content"
D
dolymood 已提交
5322
  }, [_c('div', {
A
AmyFoxFN 已提交
5323 5324
    ref: "listWrapper",
    staticClass: "cube-scroll-list-wrapper"
D
dolymood 已提交
5325
  }, [_vm._t("default", [_c('ul', {
D
dolymood 已提交
5326
    staticClass: "cube-scroll-list"
D
dolymood 已提交
5327 5328
  }, _vm._l((_vm.data), function(item) {
    return _c('li', {
D
dolymood 已提交
5329
      staticClass: "cube-scroll-item border-bottom-1px",
D
dolymood 已提交
5330 5331 5332 5333 5334 5335
      on: {
        "click": function($event) {
          _vm.clickItem(item)
        }
      }
    }, [_vm._v(_vm._s(item))])
D
dolymood 已提交
5336
  }))])], 2), _vm._v(" "), _vm._t("pullup", [(_vm.pullUpLoad) ? _c('div', {
D
dolymood 已提交
5337
    staticClass: "cube-pullup-wrapper"
A
AmyFoxFN 已提交
5338
  }, [(!_vm.isPullUpLoad) ? _c('div', {
D
dolymood 已提交
5339
    staticClass: "before-trigger"
A
AmyFoxFN 已提交
5340
  }, [_c('span', [_vm._v(_vm._s(_vm.pullUpTxt))])]) : _c('div', {
D
dolymood 已提交
5341
    staticClass: "after-trigger"
A
AmyFoxFN 已提交
5342
  }, [_c('loading')], 1)]) : _vm._e()], {
D
dolymood 已提交
5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367
    pullUpLoad: _vm.pullUpLoad,
    isPullUpLoad: _vm.isPullUpLoad
  })], 2), _vm._v(" "), _vm._t("pulldown", [(_vm.pullDownRefresh) ? _c('div', {
    staticClass: "cube-pulldown-wrapper",
    style: (_vm.pullDownStyle)
  }, [(_vm.beforePullDown) ? _c('div', {
    staticClass: "before-trigger"
  }, [_c('bubble', {
    attrs: {
      "y": _vm.bubbleY
    }
  })], 1) : _c('div', {
    staticClass: "after-trigger"
  }, [(_vm.isPullingDown) ? _c('div', {
    staticClass: "loading"
  }, [_c('loading')], 1) : _c('div', [_c('span', [_vm._v(_vm._s(_vm.refreshTxt))])])])]) : _vm._e()], {
    pullDownRefresh: _vm.pullDownRefresh,
    pullDownStyle: _vm.pullDownStyle,
    beforePullDown: _vm.beforePullDown,
    isPullingDown: _vm.isPullingDown,
    bubbleY: _vm.bubbleY
  })], 2)
},staticRenderFns: []}

/***/ }),
A
AmyFoxFN 已提交
5368 5369 5370
/* 137 */,
/* 138 */,
/* 139 */,
A
AmyFoxFN 已提交
5371 5372
/* 140 */,
/* 141 */,
D
dolymood 已提交
5373 5374 5375 5376
/* 142 */,
/* 143 */,
/* 144 */,
/* 145 */,
D
dolymood 已提交
5377 5378
/* 146 */,
/* 147 */,
D
dolymood 已提交
5379 5380 5381 5382 5383 5384 5385
/* 148 */,
/* 149 */,
/* 150 */,
/* 151 */,
/* 152 */,
/* 153 */,
/* 154 */,
A
AmyFoxFN 已提交
5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410
/* 155 */,
/* 156 */,
/* 157 */,
/* 158 */,
/* 159 */,
/* 160 */,
/* 161 */,
/* 162 */,
/* 163 */,
/* 164 */,
/* 165 */,
/* 166 */,
/* 167 */,
/* 168 */,
/* 169 */,
/* 170 */,
/* 171 */,
/* 172 */,
/* 173 */,
/* 174 */,
/* 175 */,
/* 176 */,
/* 177 */,
/* 178 */,
/* 179 */,
A
AmyFoxFN 已提交
5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544
/* 180 */,
/* 181 */,
/* 182 */,
/* 183 */,
/* 184 */,
/* 185 */,
/* 186 */,
/* 187 */,
/* 188 */,
/* 189 */,
/* 190 */,
/* 191 */,
/* 192 */,
/* 193 */,
/* 194 */,
/* 195 */,
/* 196 */,
/* 197 */,
/* 198 */,
/* 199 */,
/* 200 */,
/* 201 */,
/* 202 */,
/* 203 */,
/* 204 */,
/* 205 */,
/* 206 */,
/* 207 */,
/* 208 */,
/* 209 */,
/* 210 */,
/* 211 */,
/* 212 */,
/* 213 */,
/* 214 */,
/* 215 */,
/* 216 */,
/* 217 */
/***/ (function(module, exports, __webpack_require__) {

var Component = __webpack_require__(1)(
  /* script */
  __webpack_require__(276),
  /* template */
  __webpack_require__(280),
  /* styles */
  null,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),
/* 218 */
/***/ (function(module, exports, __webpack_require__) {

function injectStyle (ssrContext) {
  __webpack_require__(277)
}
var Component = __webpack_require__(1)(
  /* script */
  __webpack_require__(278),
  /* template */
  __webpack_require__(279),
  /* styles */
  injectStyle,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),
/* 219 */,
/* 220 */,
/* 221 */,
/* 222 */,
/* 223 */,
/* 224 */,
/* 225 */,
/* 226 */,
/* 227 */,
/* 228 */,
/* 229 */,
/* 230 */,
/* 231 */,
/* 232 */,
/* 233 */,
/* 234 */,
/* 235 */,
/* 236 */,
/* 237 */,
/* 238 */,
/* 239 */,
/* 240 */,
/* 241 */,
/* 242 */,
/* 243 */,
/* 244 */,
/* 245 */,
/* 246 */,
/* 247 */,
/* 248 */,
/* 249 */,
/* 250 */,
/* 251 */,
/* 252 */,
/* 253 */,
/* 254 */,
/* 255 */,
/* 256 */,
/* 257 */,
/* 258 */,
/* 259 */,
/* 260 */,
/* 261 */,
/* 262 */,
/* 263 */,
/* 264 */,
/* 265 */,
/* 266 */,
/* 267 */,
/* 268 */,
/* 269 */,
/* 270 */,
/* 271 */,
/* 272 */
D
dolymood 已提交
5545 5546 5547 5548
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
A
AmyFoxFN 已提交
5549
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(273), __webpack_require__(217), __webpack_require__(218)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
D
dolymood 已提交
5550 5551 5552 5553
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
D
dolymood 已提交
5554
    factory(module, exports, require('../../components/index-list/index-list.vue'), require('../../components/index-list/index-list-group.vue'), require('../../components/index-list/index-list-item.vue'));
D
dolymood 已提交
5555 5556 5557 5558
  } else {
    var mod = {
      exports: {}
    };
D
dolymood 已提交
5559
    factory(mod, mod.exports, global.indexList, global.indexListGroup, global.indexListItem);
D
dolymood 已提交
5560 5561
    global.index = mod.exports;
  }
D
dolymood 已提交
5562
})(this, function (module, exports, _indexList, _indexListGroup, _indexListItem) {
D
dolymood 已提交
5563 5564 5565 5566 5567 5568 5569 5570
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _indexList2 = _interopRequireDefault(_indexList);

D
dolymood 已提交
5571 5572 5573 5574
  var _indexListGroup2 = _interopRequireDefault(_indexListGroup);

  var _indexListItem2 = _interopRequireDefault(_indexListItem);

D
dolymood 已提交
5575 5576 5577 5578 5579 5580 5581 5582
  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  _indexList2.default.install = function (Vue) {
    Vue.component(_indexList2.default.name, _indexList2.default);
D
dolymood 已提交
5583 5584
    Vue.component(_indexListGroup2.default.name, _indexListGroup2.default);
    Vue.component(_indexListItem2.default.name, _indexListItem2.default);
D
dolymood 已提交
5585 5586
  };

D
dolymood 已提交
5587 5588 5589
  _indexList2.default.Group = _indexListGroup2.default;
  _indexList2.default.Item = _indexListItem2.default;

D
dolymood 已提交
5590 5591 5592 5593 5594
  exports.default = _indexList2.default;
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
5595
/* 273 */
D
dolymood 已提交
5596 5597 5598
/***/ (function(module, exports, __webpack_require__) {

function injectStyle (ssrContext) {
A
AmyFoxFN 已提交
5599
  __webpack_require__(274)
D
dolymood 已提交
5600
}
A
AmyFoxFN 已提交
5601
var Component = __webpack_require__(1)(
D
dolymood 已提交
5602
  /* script */
A
AmyFoxFN 已提交
5603
  __webpack_require__(275),
D
dolymood 已提交
5604
  /* template */
A
AmyFoxFN 已提交
5605
  __webpack_require__(281),
D
dolymood 已提交
5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617
  /* styles */
  injectStyle,
  /* scopeId */
  null,
  /* moduleIdentifier (server only) */
  null
)

module.exports = Component.exports


/***/ }),
A
AmyFoxFN 已提交
5618
/* 274 */
D
dolymood 已提交
5619 5620 5621 5622 5623
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
A
AmyFoxFN 已提交
5624
/* 275 */
D
dolymood 已提交
5625 5626 5627 5628
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
A
AmyFoxFN 已提交
5629
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(91), __webpack_require__(77), __webpack_require__(119), __webpack_require__(217)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
D
dolymood 已提交
5630 5631 5632 5633
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
A
AmyFoxFN 已提交
5634
    factory(module, exports, require('../../common/helpers/dom'), require('../../common/helpers/env'), require('../scroll/scroll.vue'), require('./index-list-group.vue'));
D
dolymood 已提交
5635 5636 5637 5638
  } else {
    var mod = {
      exports: {}
    };
A
AmyFoxFN 已提交
5639
    factory(mod, mod.exports, global.dom, global.env, global.scroll, global.indexListGroup);
D
dolymood 已提交
5640 5641
    global.indexList = mod.exports;
  }
A
AmyFoxFN 已提交
5642
})(this, function (module, exports, _dom, _env, _scroll, _indexListGroup) {
D
dolymood 已提交
5643 5644 5645 5646 5647 5648 5649 5650
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _scroll2 = _interopRequireDefault(_scroll);

D
dolymood 已提交
5651 5652
  var _indexListGroup2 = _interopRequireDefault(_indexListGroup);

D
dolymood 已提交
5653 5654 5655 5656 5657 5658 5659 5660 5661 5662
  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  var COMPONENT_NAME = 'cube-index-list';
  var EVENT_SELECT = 'select';
  var EVENT_TITLE_CLICK = 'title-click';

A
AmyFoxFN 已提交
5663
  var ANCHOR_HEIGHT = _env.inBrowser ? window.innerHeight <= 480 ? 17 : 18 : 18;
D
dolymood 已提交
5664
  var transformStyleKey = (0, _dom.prefixStyle)('transform');
D
dolymood 已提交
5665 5666 5667 5668 5669 5670 5671 5672 5673 5674

  exports.default = {
    name: COMPONENT_NAME,
    props: {
      title: {
        type: String,
        default: ''
      },
      data: {
        type: Array,
D
dolymood 已提交
5675 5676 5677
        default: function _default() {
          return [];
        }
D
dolymood 已提交
5678 5679 5680
      },
      speed: {
        type: Number,
A
AmyFoxFN 已提交
5681
        default: 0
D
dolymood 已提交
5682 5683 5684 5685
      },
      navbar: {
        type: Boolean,
        default: true
D
dolymood 已提交
5686 5687 5688 5689 5690 5691
      }
    },
    data: function data() {
      return {
        currentIndex: 0,
        scrollY: -1,
D
dolymood 已提交
5692 5693 5694
        diff: -1,
        options: {
          probeType: 3
D
dolymood 已提交
5695 5696
        },
        titleHeight: null
D
dolymood 已提交
5697 5698 5699 5700
      };
    },
    created: function created() {
      this.listenScroll = true;
D
dolymood 已提交
5701
      this.groupList = [];
D
dolymood 已提交
5702 5703
      this.listHeight = [];
      this.touch = {};
D
dolymood 已提交
5704
      this.subTitleHeight = 0;
D
dolymood 已提交
5705 5706 5707 5708
    },
    mounted: function mounted() {
      var _this = this;

D
dolymood 已提交
5709 5710
      this.$nextTick(function () {
        _this.titleHeight = _this.title && _this.$refs.title ? (0, _dom.getRect)(_this.$refs.title).height : 0;
D
dolymood 已提交
5711
        _this._calculateHeight();
D
dolymood 已提交
5712
      });
D
dolymood 已提交
5713 5714 5715 5716
    },

    computed: {
      fixedTitle: function fixedTitle() {
D
dolymood 已提交
5717
        if (this.titleHeight === null || this.scrollY > -this.titleHeight) {
D
dolymood 已提交
5718 5719 5720 5721 5722 5723
          return '';
        }
        return this.data[this.currentIndex] ? this.data[this.currentIndex].name : '';
      },
      shortcutList: function shortcutList() {
        return this.data.map(function (group) {
D
dolymood 已提交
5724
          return group ? group.shortcut || group.name.substr(0, 1) : '';
D
dolymood 已提交
5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757
        });
      }
    },
    methods: {
      refresh: function refresh() {
        this.$refs.indexList.refresh();
      },
      selectItem: function selectItem(item) {
        this.$emit(EVENT_SELECT, item);
      },
      scroll: function scroll(pos) {
        this.scrollY = pos.y;
      },
      titleClick: function titleClick() {
        this.$emit(EVENT_TITLE_CLICK, this.title);
      },
      onShortcutTouchStart: function onShortcutTouchStart(e) {
        var anchorIndex = (0, _dom.getData)(e.target, 'index');
        var firstTouch = e.touches[0];
        this.touch.y1 = firstTouch.pageY;
        this.touch.anchorIndex = anchorIndex;

        this._scrollTo(anchorIndex);
      },
      onShortcutTouchMove: function onShortcutTouchMove(e) {
        var firstTouch = e.touches[0];
        this.touch.y2 = firstTouch.pageY;
        var delta = (this.touch.y2 - this.touch.y1) / ANCHOR_HEIGHT | 0;
        var anchorIndex = parseInt(this.touch.anchorIndex) + delta;

        this._scrollTo(anchorIndex);
      },
      _calculateHeight: function _calculateHeight() {
D
dolymood 已提交
5758
        this.groupList = this.$el.getElementsByClassName('cube-index-list-group');
A
AmyFoxFN 已提交
5759 5760 5761
        var subTitleEl = this.$el.getElementsByClassName('cube-index-list-anchor')[0];
        this.subTitleHeight = subTitleEl ? (0, _dom.getRect)(subTitleEl).height : 0;
        this.listHeight = [];
D
dolymood 已提交
5762 5763

        if (!this.groupList) {
D
dolymood 已提交
5764 5765
          return;
        }
D
dolymood 已提交
5766 5767

        var height = this.titleHeight;
D
dolymood 已提交
5768
        this.listHeight.push(height);
D
dolymood 已提交
5769 5770
        for (var i = 0; i < this.groupList.length; i++) {
          var item = this.groupList[i];
D
dolymood 已提交
5771 5772 5773 5774 5775 5776 5777 5778 5779 5780
          height += item.clientHeight;
          this.listHeight.push(height);
        }
      },
      _scrollTo: function _scrollTo(index) {
        if (index < 0) {
          index = 0;
        } else if (index > this.listHeight.length - 2) {
          index = this.listHeight.length - 2;
        }
D
dolymood 已提交
5781
        this.$refs.indexList.scrollToElement(this.groupList[index], this.speed);
D
dolymood 已提交
5782 5783 5784 5785 5786 5787 5788
        this.scrollY = this.$refs.indexList.scroll.y;
      }
    },
    watch: {
      data: function data() {
        var _this2 = this;

D
dolymood 已提交
5789
        this.$nextTick(function () {
D
dolymood 已提交
5790
          _this2._calculateHeight();
D
dolymood 已提交
5791 5792 5793 5794 5795 5796 5797 5798 5799
        });
      },
      title: function title(newVal) {
        var _this3 = this;

        this.$nextTick(function () {
          _this3.titleHeight = newVal && _this3.$refs.title ? (0, _dom.getRect)(_this3.$refs.title).height : 0;
          _this3._calculateHeight();
        });
D
dolymood 已提交
5800 5801
      },
      diff: function diff(newVal) {
D
dolymood 已提交
5802
        var fixedTop = newVal > 0 && newVal < this.subTitleHeight ? newVal - this.subTitleHeight : 0;
D
dolymood 已提交
5803 5804 5805 5806
        if (this.fixedTop === fixedTop) {
          return;
        }
        this.fixedTop = fixedTop;
D
dolymood 已提交
5807
        this.$refs.fixed.style[transformStyleKey] = 'translate3d(0,' + fixedTop + 'px,0)';
D
dolymood 已提交
5808 5809 5810 5811
      },
      scrollY: function scrollY(newY) {
        var listHeight = this.listHeight;

D
dolymood 已提交
5812
        if (newY > -this.titleHeight) {
D
dolymood 已提交
5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830
          this.currentIndex = 0;
          return;
        }

        for (var i = 0; i < listHeight.length - 1; i++) {
          var height1 = listHeight[i];
          var height2 = listHeight[i + 1];
          if (-newY >= height1 && -newY < height2) {
            this.currentIndex = i;
            this.diff = height2 + newY;
            return;
          }
        }

        this.currentIndex = listHeight.length - 2;
      }
    },
    components: {
D
dolymood 已提交
5831 5832
      CubeScroll: _scroll2.default,
      CubeIndexListGroup: _indexListGroup2.default
D
dolymood 已提交
5833 5834 5835 5836 5837 5838
    }
  };
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
5839
/* 276 */
D
dolymood 已提交
5840 5841 5842 5843
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
A
AmyFoxFN 已提交
5844
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(218)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
D
dolymood 已提交
5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports, require('./index-list-item.vue'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports, global.indexListItem);
    global.indexListGroup = mod.exports;
  }
})(this, function (module, exports, _indexListItem) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });

  var _indexListItem2 = _interopRequireDefault(_indexListItem);

  function _interopRequireDefault(obj) {
    return obj && obj.__esModule ? obj : {
      default: obj
    };
  }

  var COMPONENT_NAME = 'cube-index-list-group';
  var EVENT_SELECT = 'select';

  exports.default = {
    name: COMPONENT_NAME,
    props: {
      group: {
        type: Object,
        default: function _default() {
          return {};
        }
      }
    },
    methods: {
      selectItem: function selectItem(item) {
        this.$emit(EVENT_SELECT, item);
      }
    },
    components: {
      CubeIndexListItem: _indexListItem2.default
    }
  };
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
5898
/* 277 */
D
dolymood 已提交
5899 5900 5901 5902 5903
/***/ (function(module, exports) {

// removed by extract-text-webpack-plugin

/***/ }),
A
AmyFoxFN 已提交
5904
/* 278 */
D
dolymood 已提交
5905 5906 5907 5908
/***/ (function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
  if (true) {
A
AmyFoxFN 已提交
5909
    !(__WEBPACK_AMD_DEFINE_ARRAY__ = [module, exports, __webpack_require__(91)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
D
dolymood 已提交
5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943
				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  } else if (typeof exports !== "undefined") {
    factory(module, exports, require('../../common/helpers/dom'));
  } else {
    var mod = {
      exports: {}
    };
    factory(mod, mod.exports, global.dom);
    global.indexListItem = mod.exports;
  }
})(this, function (module, exports, _dom) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });


  var COMPONENT_NAME = 'cube-index-list-item';
  var ACTIVE_CLS = 'cube-index-list-item_active';
  var EVENT_SELECT = 'select';

  exports.default = {
    name: COMPONENT_NAME,
    props: {
      item: {
        type: Object,
        default: function _default() {
          return {};
        }
      }
    },
A
AmyFoxFN 已提交
5944 5945 5946 5947 5948
    computed: {
      itemClass: function itemClass() {
        return this.item.active ? ACTIVE_CLS : '';
      }
    },
D
dolymood 已提交
5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964
    methods: {
      addActiveCls: function addActiveCls(e) {
        (0, _dom.addClass)(e.currentTarget, ACTIVE_CLS);
      },
      removeActiveCls: function removeActiveCls(e) {
        (0, _dom.removeClass)(e.currentTarget, ACTIVE_CLS);
      },
      selectItem: function selectItem() {
        this.$emit(EVENT_SELECT, this.item);
      }
    }
  };
  module.exports = exports['default'];
});

/***/ }),
A
AmyFoxFN 已提交
5965
/* 279 */
D
dolymood 已提交
5966 5967 5968
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
A
AmyFoxFN 已提交
5969
  return _c('li', {
D
dolymood 已提交
5970
    staticClass: "cube-index-list-item",
A
AmyFoxFN 已提交
5971
    class: _vm.itemClass,
D
dolymood 已提交
5972 5973 5974 5975 5976 5977 5978
    on: {
      "touchstart": _vm.addActiveCls,
      "touchend": _vm.removeActiveCls,
      "click": function($event) {
        _vm.selectItem()
      }
    }
D
dolymood 已提交
5979 5980 5981
  }, [_vm._t("default", [_c('div', {
    staticClass: "cube-index-list-item-def border-bottom-1px"
  }, [_vm._v("\n      " + _vm._s(_vm.item.name) + "\n    ")])])], 2)
D
dolymood 已提交
5982 5983 5984
},staticRenderFns: []}

/***/ }),
A
AmyFoxFN 已提交
5985
/* 280 */
D
dolymood 已提交
5986 5987 5988
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
A
AmyFoxFN 已提交
5989
  return _c('li', {
D
dolymood 已提交
5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006
    staticClass: "cube-index-list-group"
  }, [_c('h2', {
    staticClass: "cube-index-list-anchor"
  }, [_vm._v(_vm._s(_vm.group.name))]), _vm._v(" "), _c('ul', [_vm._t("default", _vm._l((_vm.group.items), function(item, index) {
    return _c('cube-index-list-item', {
      key: index,
      attrs: {
        "item": item
      },
      on: {
        "select": _vm.selectItem
      }
    })
  }))], 2)])
},staticRenderFns: []}

/***/ }),
A
AmyFoxFN 已提交
6007
/* 281 */
D
dolymood 已提交
6008 6009 6010 6011 6012 6013 6014 6015 6016
/***/ (function(module, exports) {

module.exports={render:function (){var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;
  return _c('div', {
    staticClass: "cube-index-list"
  }, [_c('cube-scroll', {
    ref: "indexList",
    attrs: {
      "listen-scroll": _vm.listenScroll,
D
dolymood 已提交
6017 6018
      "options": _vm.options,
      "data": _vm.data
D
dolymood 已提交
6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031
    },
    on: {
      "scroll": _vm.scroll
    }
  }, [_c('div', {
    ref: "content",
    staticClass: "cube-index-list-content"
  }, [(_vm.title) ? _c('h1', {
    ref: "title",
    staticClass: "cube-index-list-title",
    on: {
      "click": _vm.titleClick
    }
D
dolymood 已提交
6032
  }, [_vm._v("\n        " + _vm._s(_vm.title) + "\n      ")]) : _vm._e(), _vm._v(" "), _c('ul', [_vm._t("default", _vm._l((_vm.data), function(group, index) {
D
dolymood 已提交
6033 6034 6035 6036 6037 6038 6039 6040 6041
    return _c('cube-index-list-group', {
      key: index,
      attrs: {
        "group": group
      },
      on: {
        "select": _vm.selectItem
      }
    })
D
dolymood 已提交
6042
  }))], 2)])]), _vm._v(" "), (_vm.navbar) ? _c('div', {
D
dolymood 已提交
6043 6044 6045 6046 6047 6048
    staticClass: "cube-index-list-nav",
    on: {
      "touchstart": _vm.onShortcutTouchStart,
      "touchmove": function($event) {
        $event.stopPropagation();
        $event.preventDefault();
A
AmyFoxFN 已提交
6049
        _vm.onShortcutTouchMove($event)
D
dolymood 已提交
6050 6051
      }
    }
A
AmyFoxFN 已提交
6052 6053 6054
  }, [_c('ul', {
    staticClass: "cube-index-list-nav-list"
  }, _vm._l((_vm.shortcutList), function(item, index) {
D
dolymood 已提交
6055
    return _c('li', {
A
AmyFoxFN 已提交
6056
      key: index,
A
AmyFoxFN 已提交
6057
      staticClass: "cube-index-list-nav-item",
D
dolymood 已提交
6058 6059 6060 6061 6062 6063
      class: {
        active: _vm.currentIndex === index
      },
      attrs: {
        "data-index": index
      }
D
dolymood 已提交
6064 6065 6066 6067
    }, [_vm._t("nav-item", [_vm._v(_vm._s(item))], {
      item: item
    })], 2)
  }))]) : _vm._e(), _vm._v(" "), _c('div', {
D
dolymood 已提交
6068 6069 6070 6071 6072 6073 6074
    directives: [{
      name: "show",
      rawName: "v-show",
      value: (_vm.fixedTitle),
      expression: "fixedTitle"
    }],
    ref: "fixed",
D
dolymood 已提交
6075
    staticClass: "cube-index-list-fixed cube-index-list-anchor"
D
dolymood 已提交
6076 6077 6078 6079 6080
  }, [_vm._v("\n    " + _vm._s(_vm.fixedTitle) + "\n  ")])], 1)
},staticRenderFns: []}

/***/ })
/******/ ]);