UNPKG

weex-vue-render

Version:

Web renderer for weex project written in Vue DSL.

1,434 lines (1,254 loc) 1.12 MB
console.log('START WEEX VUE RENDER: 1.0.36, Build 2018-12-29 17:52.'); (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global.WeexVueRender = factory()); }(this, (function () { 'use strict'; function __$styleInject(css, returnValue) { if (typeof document === 'undefined') { return returnValue; } css = css || ''; var head = document.head || document.getElementsByTagName('head')[0]; var style = document.createElement('style'); style.type = 'text/css'; head.appendChild(style); if (style.styleSheet){ style.styleSheet.cssText = css; } else { style.appendChild(document.createTextNode(css)); } return returnValue; } __$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n.weex-root,\n.weex-root * {\n color: initial;\n cursor: initial;\n direction: inherit;\n /* In chrome, there's a chance that user set the miximum font-size to \n a abnormal smaller size. But actually the smaller size is never working\n if this font / font-size default value is set to initial. Perhaps a bug\n for chrome. */\n font: initial;\n font-size: initial;\n font-family: initial;\n font-style: initial;\n font-variant: initial;\n font-weight: initial;\n line-height: initial;\n text-align: initial;\n text-indent: initial;\n visibility: initial;\n white-space: initial;\n word-spacing: initial;\n font-family: BlinkMacSystemFont, 'Source Sans Pro', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n}\n\n.weex-root,\n.weex-root *,\n.weex-root *::before,\n.weex-root *::after {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-text-size-adjust: none;\n -moz-text-size-adjust: none;\n -ms-text-size-adjust: none;\n text-size-adjust: none;\n}\n\n.weex-root a,\n.weex-root button,\n.weex-root [role=\"button\"],\n.weex-root input,\n.weex-root label,\n.weex-root select,\n.weex-root textarea {\n touch-action: manipulation;\n}\n\n.weex-root p,\n.weex-root ol,\n.weex-root ul,\n.weex-root dl,\n.weex-root figure {\n margin: 0;\n padding: 0;\n}\n\n.weex-root li {\n list-style: none;\n}\n\n.weex-root figure {\n margin: 0;\n}\n\n.weex-root textarea {\n resize: none;\n}\n\n/* show no scroll bar. */\n::-webkit-scrollbar {\n display: none;\n}\n",undefined); __$styleInject("/*\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n \n.weex-root * {\n border-width: 0;\n border-color: inherit;\n border-style: solid;\n}\n\ndiv.weex-root {\n min-height: 100%;\n}\n\n/**\n * slider will overflow in horizontal axis, which will cause container\n * horizontally expanding. below styles will prevent this from happening.\n */\n.weex-root {\n width: 100%;\n overflow-x: hidden;\n}\n\n.weex-root figure {\n background-repeat: no-repeat;\n background-position: 50% 50%;\n}\n\n.weex-flex-ct {\n display: -webkit-box;\n display: -webkit-flex;\n display: flex;\n}\n\n.weex-ct {\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: -webkit-box;\n display: -webkit-flex;\n display: flex;\n position: relative;\n -webkit-box-orient: vertical;\n -webkit-box-direction: normal;\n -webkit-flex-direction: column;\n flex-direction: column;\n -webkit-flex-shrink: 0;\n flex-shrink: 0;\n -webkit-box-flex: 0;\n -webkit-flex-grow: 0;\n flex-grow: 0;\n -webkit-flex-basis: auto;\n flex-basis: auto;\n -webkit-box-align: stretch;\n -webkit-align-items: stretch;\n align-items: stretch;\n -webkit-align-content: flex-start;\n align-content: flex-start;\n border: 0 solid black;\n margin: 0;\n padding: 0;\n min-width: 0;\n}\n\n.weex-ct.horizontal {\n -webkit-box-orient: horizontal;\n -webkit-box-direction: normal;\n -webkit-flex-direction: row;\n flex-direction: row;\n}\n\n.weex-el {\n display: block;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n position: relative;\n -webkit-flex-shrink: 0;\n flex-shrink: 0;\n -webkit-box-flex: 0;\n -webkit-flex-grow: 0;\n flex-grow: 0;\n -webkit-flex-basis: auto;\n flex-basis: auto;\n border: 0 solid black;\n margin: 0;\n padding: 0;\n min-width: 0;\n}\n\n.weex-text {\n display: -webkit-box;\n display: -moz-box;\n -webkit-box-orient: vertical;\n position: relative;\n white-space: pre-wrap; /* not using 'pre': support auto line feed. */\n font-size: 0.4266666666666667rem;\n word-wrap: break-word;\n overflow: hidden; /* it'll be clipped if the height is not high enough. */\n}\n\n.weex-image {\n background-repeat: no-repeat;\n background-position: 50% 50%;\n background-size: 100% 100%;\n}\n\n.weex-a {\n text-decoration: none;\n}\n\n.weex-ios-sticky {\n position: -webkit-sticky !important;\n position: sticky !important;\n z-index: 9999;\n top: 0;\n}\n\n.weex-fixed {\n position: fixed;\n z-index: 1;\n}\n\n.weex-sticky {\n position: fixed;\n top: 0;\n z-index: 9999;\n}\n",undefined); // 7.1.4 ToInteger var ceil = Math.ceil; var floor = Math.floor; var _toInteger = function (it) { return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); }; // 7.2.1 RequireObjectCoercible(argument) var _defined = function (it) { if (it == undefined) { throw TypeError("Can't call method on " + it); } return it; }; // true -> String#at // false -> String#codePointAt var _stringAt = 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; }; }; var _library = false; function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } var _global = createCommonjsModule(function (module) { // 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 }); var _core = createCommonjsModule(function (module) { var core = module.exports = { version: '2.5.2' }; if (typeof __e == 'number') { __e = core; } // eslint-disable-line no-undef }); var _core_1 = _core.version; var _isObject = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; var _anObject = function (it) { if (!_isObject(it)) { throw TypeError(it + ' is not an object!'); } return it; }; var _fails = function (exec) { try { return !!exec(); } catch (e) { return true; } }; // Thank's IE8 for his funny defineProperty var _descriptors = !_fails(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); var document$1 = _global.document; // typeof document.createElement is 'object' in old IE var is = _isObject(document$1) && _isObject(document$1.createElement); var _domCreate = function (it) { return is ? document$1.createElement(it) : {}; }; var _ie8DomDefine = !_descriptors && !_fails(function () { return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7; }); // 7.1.1 ToPrimitive(input [, PreferredType]) // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string var _toPrimitive = 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"); }; var dP = Object.defineProperty; var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) { _anObject(O); P = _toPrimitive(P, true); _anObject(Attributes); if (_ie8DomDefine) { 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; }; var _objectDp = { f: f }; var _propertyDesc = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; var _hide = _descriptors ? function (object, key, value) { return _objectDp.f(object, key, _propertyDesc(1, value)); } : function (object, key, value) { object[key] = value; return object; }; var hasOwnProperty = {}.hasOwnProperty; var _has = function (it, key) { return hasOwnProperty.call(it, key); }; var id = 0; var px = Math.random(); var _uid = function (key) { return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); }; var _redefine = createCommonjsModule(function (module) { var SRC = _uid('src'); var TO_STRING = 'toString'; var $toString = Function[TO_STRING]; var TPL = ('' + $toString).split(TO_STRING); _core.inspectSource = function (it) { return $toString.call(it); }; (module.exports = function (O, key, val, safe) { var isFunction = typeof val == 'function'; if (isFunction) { _has(val, 'name') || _hide(val, 'name', key); } if (O[key] === val) { return; } if (isFunction) { _has(val, SRC) || _hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); } if (O === _global) { O[key] = val; } else if (!safe) { delete O[key]; _hide(O, key, val); } else if (O[key]) { O[key] = val; } else { _hide(O, key, val); } // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, TO_STRING, function toString() { return typeof this == 'function' && this[SRC] || $toString.call(this); }); }); var _aFunction = function (it) { if (typeof it != 'function') { throw TypeError(it + ' is not a function!'); } return it; }; // optional / simple context binding var _ctx = 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); }; }; 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 target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] || (_global[name] = {}) : (_global[name] || {})[PROTOTYPE]; var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {}); var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); var key, own, out, exp; if (IS_GLOBAL) { source = name; } for (key in source) { // contains in native own = !IS_FORCED && target && target[key] !== undefined; // export native or passed out = (own ? target : source)[key]; // bind timers to global for call from export context exp = IS_BIND && own ? _ctx(out, _global) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out; // extend global if (target) { _redefine(target, key, out, type & $export.U); } // export if (exports[key] != out) { _hide(exports, key, exp); } if (IS_PROTO && expProto[key] != out) { expProto[key] = out; } } }; _global.core = _core; // 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` var _export = $export; var _iterators = {}; var toString = {}.toString; var _cof = function (it) { return toString.call(it).slice(8, -1); }; // fallback for non-array-like ES3 and non-enumerable old V8 strings // eslint-disable-next-line no-prototype-builtins var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return _cof(it) == 'String' ? it.split('') : Object(it); }; // to indexed object, toObject with fallback for non-array-like ES3 strings var _toIobject = function (it) { return _iobject(_defined(it)); }; // 7.1.15 ToLength var min = Math.min; var _toLength = function (it) { return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 }; var max = Math.max; var min$1 = Math.min; var _toAbsoluteIndex = function (index, length) { index = _toInteger(index); return index < 0 ? max(index + length, 0) : min$1(index, length); }; // false -> Array#indexOf // true -> Array#includes var _arrayIncludes = 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; }; }; var SHARED = '__core-js_shared__'; var store = _global[SHARED] || (_global[SHARED] = {}); var _shared = function (key) { return store[key] || (store[key] = {}); }; var shared = _shared('keys'); var _sharedKey = function (key) { return shared[key] || (shared[key] = _uid(key)); }; var arrayIndexOf = _arrayIncludes(false); var IE_PROTO$1 = _sharedKey('IE_PROTO'); var _objectKeysInternal = function (object, names) { var O = _toIobject(object); var i = 0; var result = []; var key; for (key in O) { if (key != IE_PROTO$1) { _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; }; // IE 8- don't enum bug keys var _enumBugKeys = ( 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' ).split(','); // 19.1.2.14 / 15.2.3.14 Object.keys(O) var _objectKeys = Object.keys || function keys(O) { return _objectKeysInternal(O, _enumBugKeys); }; var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) { _anObject(O); var keys = _objectKeys(Properties); var length = keys.length; var i = 0; var P; while (length > i) { _objectDp.f(O, P = keys[i++], Properties[P]); } return O; }; var document$2 = _global.document; var _html = document$2 && document$2.documentElement; // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var IE_PROTO = _sharedKey('IE_PROTO'); var Empty = function () { /* empty */ }; var PROTOTYPE$1 = '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 = _domCreate('iframe'); var i = _enumBugKeys.length; var lt = '<'; var gt = '>'; var iframeDocument; iframe.style.display = 'none'; _html.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$1][_enumBugKeys[i]]; } return createDict(); }; var _objectCreate = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE$1] = _anObject(O); result = new Empty(); Empty[PROTOTYPE$1] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else { result = createDict(); } return Properties === undefined ? result : _objectDps(result, Properties); }; var _wks = createCommonjsModule(function (module) { var store = _shared('wks'); var Symbol = _global.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; }); var def = _objectDp.f; var TAG = _wks('toStringTag'); var _setToStringTag = function (it, tag, stat) { if (it && !_has(it = stat ? it : it.prototype, TAG)) { def(it, TAG, { configurable: true, value: tag }); } }; var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() _hide(IteratorPrototype, _wks('iterator'), function () { return this; }); var _iterCreate = function (Constructor, NAME, next) { Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) }); _setToStringTag(Constructor, NAME + ' Iterator'); }; // 7.1.13 ToObject(argument) var _toObject = function (it) { return Object(_defined(it)); }; // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) var IE_PROTO$2 = _sharedKey('IE_PROTO'); var ObjectProto = Object.prototype; var _objectGpo = Object.getPrototypeOf || function (O) { O = _toObject(O); if (_has(O, IE_PROTO$2)) { return O[IE_PROTO$2]; } if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectProto : null; }; var ITERATOR = _wks('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; var VALUES = 'values'; var returnThis = function () { return this; }; var _iterDefine = 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 = $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 = _objectGpo($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; }; var $at = _stringAt(true); // 21.1.3.27 String.prototype[@@iterator]() _iterDefine(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 }; }); // call something on iterator step with safe closing on error var _iterCall = 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; } }; // check on default Array iterator var ITERATOR$1 = _wks('iterator'); var ArrayProto = Array.prototype; var _isArrayIter = function (it) { return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$1] === it); }; var _createProperty = function (object, index, value) { if (index in object) { _objectDp.f(object, index, _propertyDesc(0, value)); } else { object[index] = value; } }; // getting tag from 19.1.3.6 Object.prototype.toString() var TAG$1 = _wks('toStringTag'); // 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 */ } }; var _classof = function (it) { var O, T, B; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T // builtinTag case : ARG ? _cof(O) // ES3 arguments fallback : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; }; var ITERATOR$2 = _wks('iterator'); var core_getIteratorMethod = _core.getIteratorMethod = function (it) { if (it != undefined) { return it[ITERATOR$2] || it['@@iterator'] || _iterators[_classof(it)]; } }; var ITERATOR$3 = _wks('iterator'); var SAFE_CLOSING = false; try { var riter = [7][ITERATOR$3](); riter['return'] = function () { SAFE_CLOSING = true; }; // eslint-disable-next-line no-throw-literal } catch (e) { /* empty */ } var _iterDetect = function (exec, skipClosing) { if (!skipClosing && !SAFE_CLOSING) { return false; } var safe = false; try { var arr = [7]; var iter = arr[ITERATOR$3](); iter.next = function () { return { done: safe = true }; }; arr[ITERATOR$3] = function () { return iter; }; exec(arr); } catch (e) { /* empty */ } return safe; }; _export(_export.S + _export.F * !_iterDetect(function (iter) { }), 'Array', { // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) from: function from(arrayLike /* mapfn = undefined, thisArg = undefined */) { var O = _toObject(arrayLike); var C = typeof this == 'function' ? this : Array; var aLen = arguments.length; var mapfn = aLen > 1 ? arguments[1] : undefined; var mapping = mapfn !== undefined; var index = 0; var iterFn = core_getIteratorMethod(O); var length, result, step, iterator; if (mapping) { mapfn = _ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); } // if object isn't iterable or it's array with default iterator - use simple case if (iterFn != undefined && !(C == Array && _isArrayIter(iterFn))) { for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { _createProperty(result, index, mapping ? _iterCall(iterator, mapfn, [step.value, index], true) : step.value); } } else { length = _toLength(O.length); for (result = new C(length); length > index; index++) { _createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); } } result.length = index; return result; } }); var from = _core.Array.from; var f$1 = Object.getOwnPropertySymbols; var _objectGops = { f: f$1 }; var f$2 = {}.propertyIsEnumerable; var _objectPie = { f: f$2 }; // 19.1.2.1 Object.assign(target, source, ...) var $assign = Object.assign; // should work with symbols and should have deterministic property order (V8 bug) var _objectAssign = !$assign || _fails(function () { 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) { var arguments$1 = arguments; // eslint-disable-line no-unused-vars var T = _toObject(target); var aLen = arguments.length; var index = 1; var getSymbols = _objectGops.f; var isEnum = _objectPie.f; while (aLen > index) { var S = _iobject(arguments$1[index++]); var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(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; // 19.1.3.1 Object.assign(target, source) _export(_export.S + _export.F, 'Object', { assign: _objectAssign }); var assign = _core.Object.assign; var gOPD = Object.getOwnPropertyDescriptor; var f$3 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) { O = _toIobject(O); P = _toPrimitive(P, true); if (_ie8DomDefine) { try { return gOPD(O, P); } catch (e) { /* empty */ } } if (_has(O, P)) { return _propertyDesc(!_objectPie.f.call(O, P), O[P]); } }; var _objectGopd = { f: f$3 }; // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ var check = function (O, proto) { _anObject(O); if (!_isObject(proto) && proto !== null) { throw TypeError(proto + ": can't set as prototype!"); } }; var _setProto = { set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line function (test, buggy, set) { try { set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2); set(test, []); buggy = !(test instanceof Array); } catch (e) { buggy = true; } return function setPrototypeOf(O, proto) { check(O, proto); if (buggy) { O.__proto__ = proto; } else { set(O, proto); } return O; }; }({}, false) : undefined), check: check }; // 19.1.3.19 Object.setPrototypeOf(O, proto) _export(_export.S, 'Object', { setPrototypeOf: _setProto.set }); var setPrototypeOf = _core.Object.setPrototypeOf; // 19.1.3.6 Object.prototype.toString() var test = {}; test[_wks('toStringTag')] = 'z'; if (test + '' != '[object z]') { _redefine(Object.prototype, 'toString', function toString() { return '[object ' + _classof(this) + ']'; }, true); } // 22.1.3.31 Array.prototype[@@unscopables] var UNSCOPABLES = _wks('unscopables'); var ArrayProto$1 = Array.prototype; if (ArrayProto$1[UNSCOPABLES] == undefined) { _hide(ArrayProto$1, UNSCOPABLES, {}); } var _addToUnscopables = function (key) { ArrayProto$1[UNSCOPABLES][key] = true; }; var _iterStep = function (done, value) { return { value: value, done: !!done }; }; // 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]() var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) { 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 _iterStep(1); } if (kind == 'keys') { return _iterStep(0, index); } if (kind == 'values') { return _iterStep(0, O[index]); } return _iterStep(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'); var ITERATOR$4 = _wks('iterator'); var TO_STRING_TAG = _wks('toStringTag'); var ArrayValues = _iterators.Array; var DOMIterables = { CSSRuleList: true, // TODO: Not spec compliant, should be false. CSSStyleDeclaration: false, CSSValueList: false, ClientRectList: false, DOMRectList: false, DOMStringList: false, DOMTokenList: true, DataTransferItemList: false, FileList: false, HTMLAllCollection: false, HTMLCollection: false, HTMLFormElement: false, HTMLSelectElement: false, MediaList: true, // TODO: Not spec compliant, should be false. MimeTypeArray: false, NamedNodeMap: false, NodeList: true, PaintRequestList: false, Plugin: false, PluginArray: false, SVGLengthList: false, SVGNumberList: false, SVGPathSegList: false, SVGPointList: false, SVGStringList: false, SVGTransformList: false, SourceBufferList: false, StyleSheetList: true, // TODO: Not spec compliant, should be false. TextTrackCueList: false, TextTrackList: false, TouchList: false }; for (var collections = _objectKeys(DOMIterables), i = 0; i < collections.length; i++) { var NAME = collections[i]; var explicit = DOMIterables[NAME]; var Collection = _global[NAME]; var proto = Collection && Collection.prototype; var key; if (proto) { if (!proto[ITERATOR$4]) { _hide(proto, ITERATOR$4, ArrayValues); } if (!proto[TO_STRING_TAG]) { _hide(proto, TO_STRING_TAG, NAME); } _iterators[NAME] = ArrayValues; if (explicit) { for (key in es6_array_iterator) { if (!proto[key]) { _redefine(proto, key, es6_array_iterator[key], true); } } } } } var _anInstance = function (it, Constructor, name, forbiddenField) { if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { throw TypeError(name + ': incorrect invocation!'); } return it; }; var _forOf = createCommonjsModule(function (module) { var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(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 = _iterCall(iterator, f, step.value, entries); if (result === BREAK || result === RETURN) { return result; } } } }; exports.BREAK = BREAK; exports.RETURN = RETURN; }); // 7.3.20 SpeciesConstructor(O, defaultConstructor) var SPECIES = _wks('species'); var _speciesConstructor = function (O, D) { var C = _anObject(O).constructor; var S; return C === undefined || (S = _anObject(C)[SPECIES]) == undefined ? D : _aFunction(S); }; // fast apply, http://jsperf.lnkit.com/fast-apply/5 var _invoke = 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); }; var process$1 = _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; var channel; var 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 arguments$1 = arguments; var args = []; var i = 1; while (arguments.length > i) { args.push(arguments$1[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- if (_cof(process$1) == 'process') { defer = function (id) { process$1.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 _domCreate('script')) { defer = function (id) { _html.appendChild(_domCreate('script'))[ONREADYSTATECHANGE] = function () { _html.removeChild(this); run.call(id); }; }; // Rest old browsers } else { defer = function (id) { setTimeout(_ctx(run, id, 1), 0); }; } } var _task = { set: setTask, clear: clearTask }; var macrotask = _task.set; var Observer = _global.MutationObserver || _global.WebKitMutationObserver; var process$2 = _global.process; var Promise = _global.Promise; var isNode$1 = _cof(process$2) == 'process'; var _microtask = function () { var head, last, notify; var flush = function () { var parent, fn; if (isNode$1 && (parent = process$2.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$1) { notify = function () { process$2.nextTick(flush); }; // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 } else if (Observer && !(_global.navigator && _global.navigator.standalone)) { 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; }; }; // 25.4.1.5 NewPromiseCapability(C) 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); } var f$4 = function (C) { return new PromiseCapability(C); }; var _newPromiseCapability = { f: f$4 }; var _perform = function (exec) { try { return { e: false, v: exec() }; } catch (e) { return { e: true, v: e }; } }; var _promiseResolve = 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; }; var _redefineAll = function (target, src, safe) { for (var key in src) { _redefine(target, key, src[key], safe); } return target; }; var SPECIES$1 = _wks('species'); var _setSpecies = function (KEY) { var C = _global[KEY]; if (_descriptors && C && !C[SPECIES$1]) { _objectDp.f(C, SPECIES$1, { configurable: true, get: function () { return this; } }); } }; var task = _task.set; var microtask = _microtask(); var PROMISE = 'Promise'; var TypeError$1 = _global.TypeError; var process = _global.process; var $Promise = _global[PROMISE]; var isNode = _classof(process) == 'process'; var empty = function () { /* empty */ }; var Internal; var newGenericPromiseCapability; var OwnPromiseCapability; var Wrapper; var newPromiseCapability = newGenericPromiseCapability = _newPromiseCapability.f; var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); var FakePromise = (promise.constructor = {})[_wks('species')] = function (exec) { 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$1('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) { if (promise._h == 1) { return false; } var chain = promise._a || promise._c; var i = 0; var reaction; while (chain.length > i) { reaction = chain[i++]; if (reaction.fail || !isUnhandled(reaction.promise)) { return false; } } return true; }; 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$1("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 }; Internal.prototype = _redefineAll($Promise.prototype, { // 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); }; _newPromiseCapability.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 }); _setToStringTag($Promise, PROMISE); _setSpecies(PROMISE); Wrapper = _core[PROMISE]; // 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); } }); _export(_export.S + _export.F * !(USE_NATIVE && _iterDetect(function (iter) { $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; } }); /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ /* eslint-disable */ var isInitialized = false; // major events supported: // panstart // panmove // panend