diff --git a/assets/js/admin.js b/assets/js/admin.js index a86f20ed..a1e62821 100644 --- a/assets/js/admin.js +++ b/assets/js/admin.js @@ -1,248 +1,637 @@ pluginWebpack([1],{ -/***/ 178: -/***/ (function(module, exports, __webpack_require__) { +/***/ 116: +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +// +// +// +// +// +// +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'App' +}); -var _App = __webpack_require__(179); +/***/ }), -var _App2 = _interopRequireDefault(_App); +/***/ 117: +/***/ (function(module, __webpack_exports__, __webpack_require__) { -var _router = __webpack_require__(182); +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_admin_components_Fields_vue__ = __webpack_require__(261); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// -var _router2 = _interopRequireDefault(_router); -var _store = __webpack_require__(29); -var _store2 = _interopRequireDefault(_store); +/* harmony default export */ __webpack_exports__["a"] = ({ -var _adminMenuFix = __webpack_require__(213); + name: 'Settings', -var _adminMenuFix2 = _interopRequireDefault(_adminMenuFix); + components: { + Fields: __WEBPACK_IMPORTED_MODULE_0_admin_components_Fields_vue__["a" /* default */] + }, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + data() { + return { + isSaved: false, + showLoading: false, + isUpdated: false, + isLoaded: false, + message: '', + currentTab: null, + settingSections: [], + settingFields: {}, + settingValues: {} + }; + }, -var Vue = wepos_get_lib('Vue'); + methods: { + changeTab(section) { + var activetab = ''; + this.currentTab = section.id; -Vue.config.productionTip = false; + if (typeof localStorage != 'undefined') { + localStorage.setItem("activetab", this.currentTab); + } + }, -/* eslint-disable no-new */ -new Vue({ - el: '#wepos-admin-app', - router: _router2.default, - store: _store2.default, - render: function render(h) { - return h(_App2.default); - }, - created: function created() { - this.setLocaleData(wepos.i18n['wepos']); - } -}); + showSectionTitle(index) { + return window.weLo_.findIndex(this.settingSections, { id: index }).title; + }, -// fix the admin menu for the slug "wepos-app" -(0, _adminMenuFix2.default)('wepos'); + fetchSettingValues() { + var self = this, + data = { + action: 'wepos_get_setting_values', + nonce: wepos.nonce + }; -/***/ }), + self.showLoading = true; -/***/ 179: -/***/ (function(module, __webpack_exports__, __webpack_require__) { + jQuery.post(wepos.ajaxurl, data, function (resp) { + if (resp.success) { -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_App_vue__ = __webpack_require__(78); -/* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6bc4b6d8_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_App_vue__ = __webpack_require__(181); -var disposed = false -function injectStyle (ssrContext) { - if (disposed) return - __webpack_require__(180) -} -var normalizeComponent = __webpack_require__(0) -/* script */ + Object.keys(self.settingFields).forEach(function (section, index) { + Object.keys(self.settingFields[section]).forEach(function (field, i) { + if (!self.settingValues[section]) { + self.settingValues[section] = {}; + } -/* template */ + if (typeof resp.data[section][field] === 'undefined') { + if (typeof self.settingFields[section][field].default === 'undefined') { + self.settingValues[section][field] = ''; + } else { + self.settingValues[section][field] = self.settingFields[section][field].default; + } + } else { + self.settingValues[section][field] = resp.data[section][field]; + } + }); + }); -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = injectStyle -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_App_vue__["a" /* default */], - __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6bc4b6d8_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_App_vue__["a" /* default */], - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "assets/src/admin/App.vue" + self.settingValues = jQuery.extend({}, self.settingValues); -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-6bc4b6d8", Component.options) - } else { - hotAPI.reload("data-v-6bc4b6d8", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} + self.showLoading = false; + self.isLoaded = true; + } + }); + }, -/* harmony default export */ __webpack_exports__["default"] = (Component.exports); + showMedia(data, $event) { + var self = this; + var file_frame = wp.media.frames.file_frame = wp.media({ + title: this.__('Choose your file', 'wepos'), + button: { + text: this.__('Select', 'wepos') + }, + multiple: false + }); -/***/ }), + file_frame.on('select', function () { + var attachment = file_frame.state().get('selection').first().toJSON(); + self.settingValues[data.sectionId][data.name] = attachment.url; + }); -/***/ 180: -/***/ (function(module, exports) { + file_frame.open(); + }, -// removed by extract-text-webpack-plugin + saveSettings(fieldData, section) { + var self = this, + data = { + action: 'wepos_save_settings', + nonce: wepos.nonce, + settingsData: fieldData, + section: section + }; + self.showLoading = true; + + jQuery.post(wepos.ajaxurl, data).done(function (response) { + var settings = response.data.settings; + self.isSaved = true; + self.isUpdated = true; + self.message = response.data.message; + self.settingValues[settings.name] = settings.value; + }).fail(function (jqXHR) { + var messages = jqXHR.responseJSON.data.map(function (error) { + return error.message; + }); + + alert(messages.join(' ')); + }).always(function () { + self.showLoading = false; + }); + } + }, + + created() { + this.fetchSettingValues(); + + this.currentTab = 'wepos_general'; + if (typeof localStorage != 'undefined') { + this.currentTab = localStorage.getItem("activetab") ? localStorage.getItem("activetab") : 'wepos_general'; + } + + this.settingSections = wepos.settings_sections; + this.settingFields = wepos.settings_fields; + } +}); /***/ }), -/***/ 181: +/***/ 118: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -var render = function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c("div", { attrs: { id: "wepos-admin-app" } }, [_c("router-view")], 1) -} -var staticRenderFns = [] -render._withStripped = true -var esExports = { render: render, staticRenderFns: staticRenderFns } -/* harmony default export */ __webpack_exports__["a"] = (esExports); -if (false) { - module.hot.accept() - if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-6bc4b6d8", esExports) - } -} +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_admin_components_ColorPicker_vue__ = __webpack_require__(263); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// -/***/ }), -/***/ 182: -/***/ (function(module, exports, __webpack_require__) { +let TextEditor = wepos_get_lib('TextEditor'); -"use strict"; +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'Fields', + components: { + colorPicker: __WEBPACK_IMPORTED_MODULE_0_admin_components_ColorPicker_vue__["a" /* default */], + TextEditor + }, -Object.defineProperty(exports, "__esModule", { - value: true -}); + data() { + return { + repeatableItem: {} + }; + }, -var _Settings = __webpack_require__(183); + props: ['id', 'fieldData', 'sectionId', 'fieldValue'], -var _Settings2 = _interopRequireDefault(_Settings); + methods: { + containCommonFields(type) { + return window.weLo_.includes([undefined, 'text', 'email', 'url', 'phone'], type); + }, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + addItem(type, name) { + this.fieldValue[name] = this.fieldValue[name] || []; -var Vue = wepos_get_lib('Vue'); -var Router = wepos_get_lib('Router'); + if (typeof this.repeatableItem[name] == 'undefined' || !this.repeatableItem[name]) { + return; + } -Vue.use(Router); + this.fieldValue[name].push({ + id: this.repeatableItem[name].trim().replace(/\s+/g, '_').toLowerCase(), + value: this.repeatableItem[name] + }); + this.repeatableItem[name] = ''; + }, + + removeItem(optionVal, name) { + this.fieldValue[name].splice(optionVal, 1); + } + } -exports.default = new Router({ - routes: wepos.hooks.applyFilters('wepos_admin_routes', [{ - path: '/settings', - name: 'Settings', - component: _Settings2.default - }]) }); /***/ }), -/***/ 183: +/***/ 119: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Settings_vue__ = __webpack_require__(79); -/* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ba26873_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Settings_vue__ = __webpack_require__(212); -var disposed = false -function injectStyle (ssrContext) { - if (disposed) return - __webpack_require__(184) -} -var normalizeComponent = __webpack_require__(0) -/* script */ - - -/* template */ - -/* template functional */ -var __vue_template_functional__ = false -/* styles */ -var __vue_styles__ = injectStyle -/* scopeId */ -var __vue_scopeId__ = null -/* moduleIdentifier (server only) */ -var __vue_module_identifier__ = null -var Component = normalizeComponent( - __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Settings_vue__["a" /* default */], - __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ba26873_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Settings_vue__["a" /* default */], - __vue_template_functional__, - __vue_styles__, - __vue_scopeId__, - __vue_module_identifier__ -) -Component.options.__file = "assets/src/admin/components/Settings.vue" +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_color_src_components_Sketch_vue__ = __webpack_require__(265); +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// -/* hot reload */ -if (false) {(function () { - var hotAPI = require("vue-hot-reload-api") - hotAPI.install(require("vue"), false) - if (!hotAPI.compatible) return - module.hot.accept() - if (!module.hot.data) { - hotAPI.createRecord("data-v-2ba26873", Component.options) - } else { - hotAPI.reload("data-v-2ba26873", Component.options) - } - module.hot.dispose(function (data) { - disposed = true - }) -})()} -/* harmony default export */ __webpack_exports__["default"] = (Component.exports); +/* harmony default export */ __webpack_exports__["a"] = ({ + components: { + Sketch: __WEBPACK_IMPORTED_MODULE_0_vue_color_src_components_Sketch_vue__["a" /* default */] + }, + + props: { + value: { + type: String, + required: true, + default: '' + }, + + format: { + type: String, + required: false, + default: 'hex', + validator(type) { + return ['hsl', 'hex', 'rgba', 'hsv'].indexOf(type) !== -1; + } + }, + + presetColors: { + type: Array, + required: false, + default() { + return ['#000', '#fff', '#d33', '#d93', '#ee2', '#81d742', '#1e73be', '#8224e3']; + } + }, + + disableAlpha: { + type: Boolean, + required: false, + default: true + }, + + disableFields: { + type: Boolean, + required: false, + default: true + } + }, + + data() { + return { + showColorPicker: false + }; + }, + + methods: { + updateColor(colors) { + let color = ''; + + if (colors[this.format]) { + color = colors[this.format]; + } + + this.$emit('input', color); + }, + + toggleColorPicker() { + this.showColorPicker = !this.showColorPicker; + }, + + setHexColor(color) { + this.updateColor({ + hex: color + }); + } + } +}); /***/ }), -/***/ 184: -/***/ (function(module, exports) { +/***/ 254: +/***/ (function(module, exports, __webpack_require__) { -// removed by extract-text-webpack-plugin +"use strict"; + + +var _App = __webpack_require__(255); + +var _App2 = _interopRequireDefault(_App); + +var _router = __webpack_require__(258); + +var _router2 = _interopRequireDefault(_router); + +var _store = __webpack_require__(52); + +var _store2 = _interopRequireDefault(_store); + +var _adminMenuFix = __webpack_require__(289); + +var _adminMenuFix2 = _interopRequireDefault(_adminMenuFix); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var Vue = wepos_get_lib('Vue'); + +Vue.config.productionTip = false; + +/* eslint-disable no-new */ +new Vue({ + el: '#wepos-admin-app', + router: _router2.default, + store: _store2.default, + render: function render(h) { + return h(_App2.default); + }, + created: function created() { + this.setLocaleData(wepos.i18n['wepos']); + } +}); + +// fix the admin menu for the slug "wepos-app" +(0, _adminMenuFix2.default)('wepos'); /***/ }), -/***/ 185: +/***/ 255: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Fields_vue__ = __webpack_require__(80); -/* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_fa8543ee_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Fields_vue__ = __webpack_require__(211); +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_App_vue__ = __webpack_require__(116); +/* empty harmony namespace reexport */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6bc4b6d8_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_App_vue__ = __webpack_require__(257); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(186) + __webpack_require__(256) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -257,14 +646,14 @@ var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( - __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Fields_vue__["a" /* default */], - __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_fa8543ee_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Fields_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_App_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_6bc4b6d8_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_App_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) -Component.options.__file = "assets/src/admin/components/Fields.vue" +Component.options.__file = "assets/src/admin/App.vue" /* hot reload */ if (false) {(function () { @@ -273,40 +662,95 @@ if (false) {(function () { if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { - hotAPI.createRecord("data-v-fa8543ee", Component.options) + hotAPI.createRecord("data-v-6bc4b6d8", Component.options) } else { - hotAPI.reload("data-v-fa8543ee", Component.options) + hotAPI.reload("data-v-6bc4b6d8", Component.options) } module.hot.dispose(function (data) { disposed = true }) })()} -/* harmony default export */ __webpack_exports__["a"] = (Component.exports); +/* harmony default export */ __webpack_exports__["default"] = (Component.exports); /***/ }), -/***/ 186: +/***/ 256: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/***/ 187: +/***/ 257: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ColorPicker_vue__ = __webpack_require__(81); -/* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_267901b1_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_ColorPicker_vue__ = __webpack_require__(210); +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { attrs: { id: "wepos-admin-app" } }, [_c("router-view")], 1) +} +var staticRenderFns = [] +render._withStripped = true +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-6bc4b6d8", esExports) + } +} + +/***/ }), + +/***/ 258: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Settings = __webpack_require__(259); + +var _Settings2 = _interopRequireDefault(_Settings); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var Vue = wepos_get_lib('Vue'); +var Router = wepos_get_lib('Router'); + +Vue.use(Router); + +exports.default = new Router({ + routes: wepos.hooks.applyFilters('wepos_admin_routes', [{ + path: '/settings', + name: 'Settings', + component: _Settings2.default + }]) +}); + +/***/ }), + +/***/ 259: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Settings_vue__ = __webpack_require__(117); +/* empty harmony namespace reexport */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ba26873_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Settings_vue__ = __webpack_require__(288); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(188) + __webpack_require__(260) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -317,18 +761,146 @@ var __vue_template_functional__ = false /* styles */ var __vue_styles__ = injectStyle /* scopeId */ -var __vue_scopeId__ = "data-v-267901b1" +var __vue_scopeId__ = null /* moduleIdentifier (server only) */ var __vue_module_identifier__ = null var Component = normalizeComponent( - __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ColorPicker_vue__["a" /* default */], - __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_267901b1_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_ColorPicker_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Settings_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2ba26873_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Settings_vue__["a" /* default */], __vue_template_functional__, __vue_styles__, __vue_scopeId__, __vue_module_identifier__ ) -Component.options.__file = "assets/src/admin/components/ColorPicker.vue" +Component.options.__file = "assets/src/admin/components/Settings.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-2ba26873", Component.options) + } else { + hotAPI.reload("data-v-2ba26873", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +/* harmony default export */ __webpack_exports__["default"] = (Component.exports); + + +/***/ }), + +/***/ 260: +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), + +/***/ 261: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Fields_vue__ = __webpack_require__(118); +/* unused harmony namespace reexport */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_fa8543ee_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Fields_vue__ = __webpack_require__(287); +var disposed = false +function injectStyle (ssrContext) { + if (disposed) return + __webpack_require__(262) +} +var normalizeComponent = __webpack_require__(3) +/* script */ + + +/* template */ + +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Fields_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_fa8543ee_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Fields_vue__["a" /* default */], + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "assets/src/admin/components/Fields.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-fa8543ee", Component.options) + } else { + hotAPI.reload("data-v-fa8543ee", Component.options) + } + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), + +/***/ 262: +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), + +/***/ 263: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ColorPicker_vue__ = __webpack_require__(119); +/* unused harmony namespace reexport */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_267901b1_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_ColorPicker_vue__ = __webpack_require__(286); +var disposed = false +function injectStyle (ssrContext) { + if (disposed) return + __webpack_require__(264) +} +var normalizeComponent = __webpack_require__(3) +/* script */ + + +/* template */ + +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = "data-v-267901b1" +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ColorPicker_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_267901b1_hasScoped_true_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_ColorPicker_vue__["a" /* default */], + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "assets/src/admin/components/ColorPicker.vue" /* hot reload */ if (false) {(function () { @@ -351,14 +923,14 @@ if (false) {(function () { /***/ }), -/***/ 188: +/***/ 264: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/***/ 210: +/***/ 286: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -450,7 +1022,7 @@ if (false) { /***/ }), -/***/ 211: +/***/ 287: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1418,7 +1990,7 @@ if (false) { /***/ }), -/***/ 212: +/***/ 288: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1608,7 +2180,7 @@ if (false) { /***/ }), -/***/ 213: +/***/ 289: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1654,7 +2226,7 @@ exports.default = menuFix; /***/ }), -/***/ 29: +/***/ 52: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1664,11 +2236,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _Cart = __webpack_require__(30); +var _Cart = __webpack_require__(53); var _Cart2 = _interopRequireDefault(_Cart); -var _Order = __webpack_require__(32); +var _Order = __webpack_require__(55); var _Order2 = _interopRequireDefault(_Order); @@ -1688,7 +2260,7 @@ exports.default = new Vuex.Store({ /***/ }), -/***/ 30: +/***/ 53: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1698,7 +2270,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _helper = __webpack_require__(31); +var _helper = __webpack_require__(54); var _helper2 = _interopRequireDefault(_helper); @@ -1980,731 +2552,159 @@ exports.default = { context.commit('calculateFee', context.getters); }, saveFeeValueAction: function saveFeeValueAction(context, feeData) { - context.commit('saveFeeValue', feeData); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - editFeeValueAction: function editFeeValueAction(context, itemKey) { - context.commit('editFeeValue', itemKey); - }, - cancelSaveFeeValueAction: function cancelSaveFeeValueAction(context, itemKey) { - context.commit('cancelSaveFeeValue', itemKey); - }, - emptyCartAction: function emptyCartAction(context) { - context.commit('emptyCart'); - }, - calculateDiscount: function calculateDiscount(context) { - context.commit('calculateDiscount', context.getters); - }, - calculateFee: function calculateFee(context) { - context.commit('calculateFee', context.getters); - } - } -}; - -/***/ }), - -/***/ 31: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - hasStock: function hasStock(product) { - var productCartQty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (!product.manage_stock) { - return 'outofstock' == product.stock_status ? false : true; - } else { - if (product.backorders_allowed) { - return true; - } else { - return product.stock_quantity > productCartQty; - } - } - } -}; - -/***/ }), - -/***/ 32: -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - namespaced: true, - state: { - orderdata: { - billing: {}, - shipping: {}, - customer_id: 0, - customer_note: '', - payment_method: '', - payment_method_title: '' - }, - canProcessPayment: false - }, - getters: { - getCanProcessPayment: function getCanProcessPayment(state) { - return state.canProcessPayment; - } - }, - mutations: { - setOrderData: function setOrderData(state, orderdata) { - if (weLo_.isEmpty(orderdata)) { - state.orderdata = { - billing: {}, - shipping: {}, - customer_id: 0, - customer_note: '', - payment_method: '', - payment_method_title: '' - }; - } else { - state.orderdata = orderdata; - } - }, - setCustomer: function setCustomer(state, customer) { - if (Object.keys(customer).length > 0) { - state.orderdata.billing = customer.billing; - state.orderdata.shipping = customer.shipping; - state.orderdata.customer_id = customer.id; - } else { - state.orderdata.billing = {}; - state.orderdata.shipping = {}; - state.orderdata.customer_id = 0; - } - }, - emptyOrderdata: function emptyOrderdata(state) { - state.orderdata = { - billing: {}, - shipping: {}, - customer_id: 0, - customer_note: '', - payment_method: '', - payment_method_title: '' - }; - }, - setCustomerNote: function setCustomerNote(state, note) { - state.orderdata.customer_note = note.trim(); - }, - removeCustomerNote: function removeCustomerNote(state) { - state.orderdata.customer_note = ''; - }, - setGateway: function setGateway(state, gateway) { - state.orderdata.payment_method = gateway.id; - state.orderdata.payment_method_title = gateway.title; - }, - setCanProcessPayment: function setCanProcessPayment(state, canProcessPayment) { - state.canProcessPayment = canProcessPayment; - } - }, - actions: { - setOrderDataAction: function setOrderDataAction(context, orderdata) { - context.commit('setOrderData', orderdata); - }, - setCustomerAction: function setCustomerAction(context, customer) { - context.commit('setCustomer', customer); - }, - emptyOrderdataAction: function emptyOrderdataAction(context) { - context.commit('emptyOrderdata'); - }, - setCustomerNoteAction: function setCustomerNoteAction(context, note) { - context.commit('setCustomerNote', note); - }, - removeCustomerNoteAction: function removeCustomerNoteAction(context) { - context.commit('removeCustomerNote'); - }, - setGatewayAction: function setGatewayAction(context, gateway) { - context.commit('setGateway', gateway); - }, - setCanProcessPaymentAction: function setCanProcessPaymentAction(context, canProcessPayment) { - context.commit('setCanProcessPayment', canProcessPayment); - } - } -}; - -/***/ }), - -/***/ 78: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// -// -// -// -// -// - -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'App' -}); - -/***/ }), - -/***/ 79: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_admin_components_Fields_vue__ = __webpack_require__(185); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - - -/* harmony default export */ __webpack_exports__["a"] = ({ - - name: 'Settings', - - components: { - Fields: __WEBPACK_IMPORTED_MODULE_0_admin_components_Fields_vue__["a" /* default */] - }, - - data() { - return { - isSaved: false, - showLoading: false, - isUpdated: false, - isLoaded: false, - message: '', - currentTab: null, - settingSections: [], - settingFields: {}, - settingValues: {} - }; - }, - - methods: { - changeTab(section) { - var activetab = ''; - this.currentTab = section.id; - - if (typeof localStorage != 'undefined') { - localStorage.setItem("activetab", this.currentTab); - } - }, - - showSectionTitle(index) { - return window.weLo_.findIndex(this.settingSections, { id: index }).title; - }, - - fetchSettingValues() { - var self = this, - data = { - action: 'wepos_get_setting_values', - nonce: wepos.nonce - }; - - self.showLoading = true; - - jQuery.post(wepos.ajaxurl, data, function (resp) { - if (resp.success) { - - Object.keys(self.settingFields).forEach(function (section, index) { - Object.keys(self.settingFields[section]).forEach(function (field, i) { - - if (!self.settingValues[section]) { - self.settingValues[section] = {}; - } - - if (typeof resp.data[section][field] === 'undefined') { - if (typeof self.settingFields[section][field].default === 'undefined') { - self.settingValues[section][field] = ''; - } else { - self.settingValues[section][field] = self.settingFields[section][field].default; - } - } else { - self.settingValues[section][field] = resp.data[section][field]; - } - }); - }); - - self.settingValues = jQuery.extend({}, self.settingValues); - - self.showLoading = false; - self.isLoaded = true; - } - }); - }, - - showMedia(data, $event) { - var self = this; - - var file_frame = wp.media.frames.file_frame = wp.media({ - title: this.__('Choose your file', 'wepos'), - button: { - text: this.__('Select', 'wepos') - }, - multiple: false - }); - - file_frame.on('select', function () { - var attachment = file_frame.state().get('selection').first().toJSON(); - self.settingValues[data.sectionId][data.name] = attachment.url; - }); - - file_frame.open(); - }, - - saveSettings(fieldData, section) { - var self = this, - data = { - action: 'wepos_save_settings', - nonce: wepos.nonce, - settingsData: fieldData, - section: section - }; - self.showLoading = true; - - jQuery.post(wepos.ajaxurl, data).done(function (response) { - var settings = response.data.settings; - self.isSaved = true; - self.isUpdated = true; - self.message = response.data.message; - self.settingValues[settings.name] = settings.value; - }).fail(function (jqXHR) { - var messages = jqXHR.responseJSON.data.map(function (error) { - return error.message; - }); - - alert(messages.join(' ')); - }).always(function () { - self.showLoading = false; - }); - } - }, - - created() { - this.fetchSettingValues(); - - this.currentTab = 'wepos_general'; - if (typeof localStorage != 'undefined') { - this.currentTab = localStorage.getItem("activetab") ? localStorage.getItem("activetab") : 'wepos_general'; - } - - this.settingSections = wepos.settings_sections; - this.settingFields = wepos.settings_fields; - } -}); - -/***/ }), - -/***/ 80: -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_admin_components_ColorPicker_vue__ = __webpack_require__(187); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - -let TextEditor = wepos_get_lib('TextEditor'); - -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'Fields', + context.commit('saveFeeValue', feeData); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + editFeeValueAction: function editFeeValueAction(context, itemKey) { + context.commit('editFeeValue', itemKey); + }, + cancelSaveFeeValueAction: function cancelSaveFeeValueAction(context, itemKey) { + context.commit('cancelSaveFeeValue', itemKey); + }, + emptyCartAction: function emptyCartAction(context) { + context.commit('emptyCart'); + }, + calculateDiscount: function calculateDiscount(context) { + context.commit('calculateDiscount', context.getters); + }, + calculateFee: function calculateFee(context) { + context.commit('calculateFee', context.getters); + } + } +}; - components: { - colorPicker: __WEBPACK_IMPORTED_MODULE_0_admin_components_ColorPicker_vue__["a" /* default */], - TextEditor - }, +/***/ }), - data() { - return { - repeatableItem: {} - }; - }, +/***/ 54: +/***/ (function(module, exports, __webpack_require__) { - props: ['id', 'fieldData', 'sectionId', 'fieldValue'], +"use strict"; - methods: { - containCommonFields(type) { - return window.weLo_.includes([undefined, 'text', 'email', 'url', 'phone'], type); - }, - addItem(type, name) { - this.fieldValue[name] = this.fieldValue[name] || []; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + hasStock: function hasStock(product) { + var productCartQty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - if (typeof this.repeatableItem[name] == 'undefined' || !this.repeatableItem[name]) { - return; + if (!product.manage_stock) { + return 'outofstock' == product.stock_status ? false : true; + } else { + if (product.backorders_allowed) { + return true; + } else { + return product.stock_quantity > productCartQty; } - - this.fieldValue[name].push({ - id: this.repeatableItem[name].trim().replace(/\s+/g, '_').toLowerCase(), - value: this.repeatableItem[name] - }); - this.repeatableItem[name] = ''; - }, - - removeItem(optionVal, name) { - this.fieldValue[name].splice(optionVal, 1); } } - -}); +}; /***/ }), -/***/ 81: -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 55: +/***/ (function(module, exports, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue_color_src_components_Sketch_vue__ = __webpack_require__(189); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// - - -/* harmony default export */ __webpack_exports__["a"] = ({ - components: { - Sketch: __WEBPACK_IMPORTED_MODULE_0_vue_color_src_components_Sketch_vue__["a" /* default */] - }, - props: { - value: { - type: String, - required: true, - default: '' +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + namespaced: true, + state: { + orderdata: { + billing: {}, + shipping: {}, + customer_id: 0, + customer_note: '', + payment_method: '', + payment_method_title: '' }, - - format: { - type: String, - required: false, - default: 'hex', - validator(type) { - return ['hsl', 'hex', 'rgba', 'hsv'].indexOf(type) !== -1; + canProcessPayment: false + }, + getters: { + getCanProcessPayment: function getCanProcessPayment(state) { + return state.canProcessPayment; + } + }, + mutations: { + setOrderData: function setOrderData(state, orderdata) { + if (weLo_.isEmpty(orderdata)) { + state.orderdata = { + billing: {}, + shipping: {}, + customer_id: 0, + customer_note: '', + payment_method: '', + payment_method_title: '' + }; + } else { + state.orderdata = orderdata; } }, - - presetColors: { - type: Array, - required: false, - default() { - return ['#000', '#fff', '#d33', '#d93', '#ee2', '#81d742', '#1e73be', '#8224e3']; + setCustomer: function setCustomer(state, customer) { + if (Object.keys(customer).length > 0) { + state.orderdata.billing = customer.billing; + state.orderdata.shipping = customer.shipping; + state.orderdata.customer_id = customer.id; + } else { + state.orderdata.billing = {}; + state.orderdata.shipping = {}; + state.orderdata.customer_id = 0; } }, - - disableAlpha: { - type: Boolean, - required: false, - default: true + emptyOrderdata: function emptyOrderdata(state) { + state.orderdata = { + billing: {}, + shipping: {}, + customer_id: 0, + customer_note: '', + payment_method: '', + payment_method_title: '' + }; }, - - disableFields: { - type: Boolean, - required: false, - default: true + setCustomerNote: function setCustomerNote(state, note) { + state.orderdata.customer_note = note.trim(); + }, + removeCustomerNote: function removeCustomerNote(state) { + state.orderdata.customer_note = ''; + }, + setGateway: function setGateway(state, gateway) { + state.orderdata.payment_method = gateway.id; + state.orderdata.payment_method_title = gateway.title; + }, + setCanProcessPayment: function setCanProcessPayment(state, canProcessPayment) { + state.canProcessPayment = canProcessPayment; } }, - - data() { - return { - showColorPicker: false - }; - }, - - methods: { - updateColor(colors) { - let color = ''; - - if (colors[this.format]) { - color = colors[this.format]; - } - - this.$emit('input', color); + actions: { + setOrderDataAction: function setOrderDataAction(context, orderdata) { + context.commit('setOrderData', orderdata); }, - - toggleColorPicker() { - this.showColorPicker = !this.showColorPicker; + setCustomerAction: function setCustomerAction(context, customer) { + context.commit('setCustomer', customer); }, - - setHexColor(color) { - this.updateColor({ - hex: color - }); + emptyOrderdataAction: function emptyOrderdataAction(context) { + context.commit('emptyOrderdata'); + }, + setCustomerNoteAction: function setCustomerNoteAction(context, note) { + context.commit('setCustomerNote', note); + }, + removeCustomerNoteAction: function removeCustomerNoteAction(context) { + context.commit('removeCustomerNote'); + }, + setGatewayAction: function setGatewayAction(context, gateway) { + context.commit('setGateway', gateway); + }, + setCanProcessPaymentAction: function setCanProcessPaymentAction(context, canProcessPayment) { + context.commit('setCanProcessPayment', canProcessPayment); } } -}); +}; /***/ }) -},[178]); \ No newline at end of file +},[254]); \ No newline at end of file diff --git a/assets/js/bootstrap.js b/assets/js/bootstrap.js index 225dbae8..ce7eb40c 100644 --- a/assets/js/bootstrap.js +++ b/assets/js/bootstrap.js @@ -1,6 +1,6 @@ pluginWebpack([2],{ -/***/ 142: +/***/ 218: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -185,7 +185,7 @@ pluginWebpack([2],{ /***/ }), -/***/ 143: +/***/ 219: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -261,7 +261,7 @@ pluginWebpack([2],{ /***/ }), -/***/ 144: +/***/ 220: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -302,7 +302,7 @@ pluginWebpack([2],{ /***/ }), -/***/ 232: +/***/ 400: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -313,75 +313,75 @@ Object.defineProperty(exports, "__esModule", { }); exports.EventBus = undefined; -var _vue = __webpack_require__(15); +var _vue = __webpack_require__(34); var _vue2 = _interopRequireDefault(_vue); -var _vueRouter = __webpack_require__(95); +var _vueRouter = __webpack_require__(171); var _vueRouter2 = _interopRequireDefault(_vueRouter); -var _vuex = __webpack_require__(97); +var _vuex = __webpack_require__(173); var _vuex2 = _interopRequireDefault(_vuex); -var _Api = __webpack_require__(233); +var _Api = __webpack_require__(401); var _Api2 = _interopRequireDefault(_Api); -var _lodash = __webpack_require__(234); +var _lodash = __webpack_require__(402); var _lodash2 = _interopRequireDefault(_lodash); -var _Mixin = __webpack_require__(374); +var _Mixin = __webpack_require__(542); var _Mixin2 = _interopRequireDefault(_Mixin); -var _vueJsPopover = __webpack_require__(93); +var _vueJsPopover = __webpack_require__(169); var _vueJsPopover2 = _interopRequireDefault(_vueJsPopover); -var _TextEditor = __webpack_require__(376); +var _TextEditor = __webpack_require__(544); var _TextEditor2 = _interopRequireDefault(_TextEditor); -var _vTooltip = __webpack_require__(92); +var _vTooltip = __webpack_require__(168); -var _vHotkey = __webpack_require__(28); +var _vHotkey = __webpack_require__(51); var _vHotkey2 = _interopRequireDefault(_vHotkey); -var _vueMultiselect = __webpack_require__(94); +var _vueMultiselect = __webpack_require__(170); var _vueMultiselect2 = _interopRequireDefault(_vueMultiselect); -var _Modal = __webpack_require__(378); +var _Modal = __webpack_require__(546); var _Modal2 = _interopRequireDefault(_Modal); -var _Switches = __webpack_require__(381); +var _Switches = __webpack_require__(549); var _Switches2 = _interopRequireDefault(_Switches); -__webpack_require__(384); +__webpack_require__(552); -var _dayjs = __webpack_require__(33); +var _dayjs = __webpack_require__(56); var _dayjs2 = _interopRequireDefault(_dayjs); -var _vueSweetalert = __webpack_require__(96); +var _vueSweetalert = __webpack_require__(172); var _vueSweetalert2 = _interopRequireDefault(_vueSweetalert); -__webpack_require__(387); +__webpack_require__(555); -var _vueDatepicker = __webpack_require__(89); +var _vueDatepicker = __webpack_require__(127); var _vueDatepicker2 = _interopRequireDefault(_vueDatepicker); -__webpack_require__(389); +__webpack_require__(557); -var _hooks = __webpack_require__(34); +var _hooks = __webpack_require__(57); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -470,7 +470,7 @@ wepos.addFilter = function (hookName, namespace, component) { /***/ }), -/***/ 233: +/***/ 401: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -558,7 +558,7 @@ exports.default = WePos_API; /***/ }), -/***/ 234: +/***/ 402: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -568,23 +568,23 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _core = __webpack_require__(236); +var _core = __webpack_require__(404); var _core2 = _interopRequireDefault(_core); -var _findindex = __webpack_require__(237); +var _findindex = __webpack_require__(405); var _findindex2 = _interopRequireDefault(_findindex); -var _truncate = __webpack_require__(300); +var _truncate = __webpack_require__(468); var _truncate2 = _interopRequireDefault(_truncate); -var _includes = __webpack_require__(311); +var _includes = __webpack_require__(479); var _includes2 = _interopRequireDefault(_includes); -var _debounce = __webpack_require__(371); +var _debounce = __webpack_require__(539); var _debounce2 = _interopRequireDefault(_debounce); @@ -597,18 +597,18 @@ _.includes = _includes2.default; _.debounce = _debounce2.default; exports.default = _; -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(235))) +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(403))) /***/ }), -/***/ 235: +/***/ 403: /***/ (function(module, exports) { module.exports = window.wepos._; /***/ }), -/***/ 374: +/***/ 542: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -618,7 +618,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _i18n = __webpack_require__(375); +var _i18n = __webpack_require__(543); exports.default = { methods: { @@ -788,7 +788,7 @@ exports.default = { /***/ }), -/***/ 375: +/***/ 543: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -913,16 +913,16 @@ var sprintf = exports.sprintf = Jed.sprintf; /***/ }), -/***/ 376: +/***/ 544: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_TextEditor_vue__ = __webpack_require__(142); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_TextEditor_vue__ = __webpack_require__(218); /* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1b8977ca_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_TextEditor_vue__ = __webpack_require__(377); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_1b8977ca_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_TextEditor_vue__ = __webpack_require__(545); var disposed = false -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -967,7 +967,7 @@ if (false) {(function () { /***/ }), -/***/ 377: +/***/ 545: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -993,20 +993,20 @@ if (false) { /***/ }), -/***/ 378: +/***/ 546: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Modal_vue__ = __webpack_require__(143); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Modal_vue__ = __webpack_require__(219); /* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e7f44b2a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Modal_vue__ = __webpack_require__(380); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_e7f44b2a_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Modal_vue__ = __webpack_require__(548); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(379) + __webpack_require__(547) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -1051,14 +1051,14 @@ if (false) {(function () { /***/ }), -/***/ 379: +/***/ 547: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/***/ 380: +/***/ 548: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1132,20 +1132,20 @@ if (false) { /***/ }), -/***/ 381: +/***/ 549: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Switches_vue__ = __webpack_require__(144); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Switches_vue__ = __webpack_require__(220); /* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_71008314_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Switches_vue__ = __webpack_require__(383); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_71008314_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Switches_vue__ = __webpack_require__(551); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(382) + __webpack_require__(550) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -1190,14 +1190,14 @@ if (false) {(function () { /***/ }), -/***/ 382: +/***/ 550: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/***/ 383: +/***/ 551: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1229,4 +1229,4 @@ if (false) { /***/ }) -},[232]); \ No newline at end of file +},[400]); \ No newline at end of file diff --git a/assets/js/frontend.js b/assets/js/frontend.js index 9f28117e..3da273ca 100644 --- a/assets/js/frontend.js +++ b/assets/js/frontend.js @@ -1,543 +1,37 @@ -pluginWebpack([0],Array(29).concat([ -/* 29 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _Cart = __webpack_require__(30); - -var _Cart2 = _interopRequireDefault(_Cart); - -var _Order = __webpack_require__(32); - -var _Order2 = _interopRequireDefault(_Order); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +pluginWebpack([0],{ -var Vue = wepos_get_lib('Vue'); -var Vuex = wepos_get_lib('Vuex'); - -Vue.use(Vuex); - -exports.default = new Vuex.Store({ - modules: { - Cart: _Cart2.default, - Order: _Order2.default - } -}); - -/***/ }), -/* 30 */ -/***/ (function(module, exports, __webpack_require__) { +/***/ 103: +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +// +// +// +// +// +// -Object.defineProperty(exports, "__esModule", { - value: true +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'App' }); -var _helper = __webpack_require__(31); - -var _helper2 = _interopRequireDefault(_helper); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = { - namespaced: true, - state: { - settings: {}, - availableTax: {}, - cartdata: { - line_items: [], - fee_lines: [] - } - }, - getters: { - getSubtotal: function getSubtotal(state) { - var subtotal = 0; - weLo_.forEach(state.cartdata.line_items, function (item, key) { - if (item.on_sale) { - subtotal += item.quantity * item.sale_price; - } else { - subtotal += item.quantity * item.regular_price; - } - }); - - return subtotal; - }, - getTotalFee: function getTotalFee(state) { - var fee = 0; - weLo_.forEach(state.cartdata.fee_lines, function (item, key) { - if (item.type == 'fee') { - fee += Math.abs(item.total); - } - }); - return fee; - }, - getTotalDiscount: function getTotalDiscount(state) { - var discount = 0; - weLo_.forEach(state.cartdata.fee_lines, function (item, key) { - if (item.type == 'discount') { - discount += Number(Math.abs(item.total)); - } - }); - - return discount; - }, - getTotalLineTax: function getTotalLineTax(state) { - var self = this, - taxLineTotal = 0; - - weLo_.forEach(state.cartdata.line_items, function (item, key) { - taxLineTotal += Math.abs(item.tax_amount * item.quantity); - }); - - return taxLineTotal; - }, - getTotalTax: function getTotalTax(state) { - var self = this, - taxLineTotal = 0, - taxFeeTotal = 0; - weLo_.forEach(state.cartdata.line_items, function (item, key) { - taxLineTotal += Math.abs(item.tax_amount * item.quantity); - }); - - if (state.settings.woo_tax != undefined && state.settings.woo_tax.wc_tax_display_cart == 'incl') { - taxLineTotal = 0; - } - - weLo_.forEach(state.cartdata.fee_lines, function (item, key) { - if (item.type == 'fee') { - if (item.tax_status == 'taxable') { - var itemTaxClass = item.tax_class === '' ? 'standard' : item.tax_class; - var taxClass = weLo_.find(state.availableTax, { 'class': itemTaxClass.toString() }); - if (taxClass !== undefined) { - taxFeeTotal += Math.abs(item.total) * Math.abs(taxClass.rate) / 100; - } - } - } - }); - - return taxLineTotal + taxFeeTotal; - }, - getOrderTotal: function getOrderTotal(state, getters) { - return getters.getSubtotal + getters.getTotalFee + getters.getTotalTax; - }, - getTotal: function getTotal(state, getters) { - return getters.getOrderTotal - getters.getTotalDiscount; - }, - getSettings: function getSettings(state, getters) { - return state.settings; - } - }, - mutations: { - setSettings: function setSettings(state, settings) { - state.settings = settings; - }, - setAvailableTax: function setAvailableTax(state, availableTax) { - state.availableTax = availableTax; - }, - setCartData: function setCartData(state, cartdata) { - if (weLo_.isEmpty(cartdata)) { - state.cartdata = { - line_items: [], - fee_lines: [] - }; - } else { - state.cartdata = Object.assign({}, cartdata); - } - }, - addToCartItem: function addToCartItem(state, product) { - var cartObject = {}; - cartObject.product_id = product.parent_id === 0 ? product.id : product.parent_id; - cartObject.name = product.name; - cartObject.quantity = 1; - cartObject.regular_price = product.regular_display_price; - cartObject.sale_price = product.sales_display_price; - cartObject.on_sale = product.on_sale; - cartObject.attribute = product.attributes; - cartObject.variation_id = product.parent_id !== 0 ? product.id : 0; - cartObject.editQuantity = false; - cartObject.type = product.type; - cartObject.tax_amount = product.tax_amount; - cartObject.manage_stock = product.manage_stock; - cartObject.stock_status = product.stock_status; - cartObject.backorders_allowed = product.backorders_allowed; - cartObject.stock_quantity = product.stock_quantity; +/***/ }), - var index = weLo_.findIndex(state.cartdata.line_items, { product_id: cartObject.product_id, variation_id: cartObject.variation_id }); - - if (index < 0) { - if (_helper2.default.hasStock(product)) { - state.cartdata.line_items.push(cartObject); - } - } else { - if (_helper2.default.hasStock(product, state.cartdata.line_items[index].quantity)) { - state.cartdata.line_items[index].quantity += 1; - } - } - }, - removeCartItem: function removeCartItem(state, itemKey) { - state.cartdata.line_items.splice(itemKey, 1); - }, - addCartItemQuantity: function addCartItemQuantity(state, itemKey) { - var item = state.cartdata.line_items[itemKey]; - if (_helper2.default.hasStock(item, item.quantity)) { - state.cartdata.line_items[itemKey].quantity++; - } - }, - removeCartItemQuantity: function removeCartItemQuantity(state, itemKey) { - var item = state.cartdata.line_items[itemKey]; - if (item.quantity <= 1) { - state.cartdata.line_items[itemKey].quantity = 1; - } else { - state.cartdata.line_items[itemKey].quantity--; - } - }, - toggleEditQuantity: function toggleEditQuantity(state, itemKey) { - state.cartdata.line_items[itemKey].editQuantity = !state.cartdata.line_items[itemKey].editQuantity; - }, - addDiscount: function addDiscount(state, discountData) { - state.cartdata.fee_lines.push({ - name: discountData.title, - type: 'discount', - value: discountData.value.toString(), - isEdit: false, - discount_type: discountData.type, - tax_status: 'none', - tax_class: '', - total: 0 - }); - }, - addFee: function addFee(state, feeData) { - state.cartdata.fee_lines.push({ - name: feeData.title, - type: 'fee', - value: feeData.value.toString(), - isEdit: false, - fee_type: feeData.type, - tax_status: 'none', - tax_class: '', - total: 0 - }); - }, - saveFeeValue: function saveFeeValue(state, item) { - state.cartdata.fee_lines.splice(item.key, 1, item.feeData); - state.cartdata.fee_lines[item.key].isEdit = false; - }, - editFeeValue: function editFeeValue(state, itemKey) { - state.cartdata.fee_lines[itemKey].isEdit = true; - }, - cancelSaveFeeValue: function cancelSaveFeeValue(state, itemKey) { - state.cartdata.fee_lines[itemKey].isEdit = false; - }, - removeFeeLineItems: function removeFeeLineItems(state, itemKey) { - state.cartdata.fee_lines.splice(itemKey, 1); - }, - emptyCart: function emptyCart(state) { - state.cartdata = { - line_items: [], - fee_lines: [] - }; - }, - calculateDiscount: function calculateDiscount(state, payload) { - if (state.cartdata.fee_lines.length > 0) { - weLo_.forEach(state.cartdata.fee_lines, function (item, key) { - if (item.type == "discount") { - if (item.discount_type == 'percent') { - state.cartdata.fee_lines[key].total = '-' + payload.getSubtotal * Math.abs(item.value) / 100; - } else { - state.cartdata.fee_lines[key].total = '-' + Math.abs(item.value); - } - } - }); - } - }, - calculateFee: function calculateFee(state, payload) { - if (state.cartdata.fee_lines.length > 0) { - weLo_.forEach(state.cartdata.fee_lines, function (item, key) { - if (item.type == 'fee') { - if (item.fee_type == 'percent') { - state.cartdata.fee_lines[key].total = (payload.getSubtotal * Math.abs(item.value) / 100).toString(); - } else { - state.cartdata.fee_lines[key].total = Math.abs(item.value).toString(); - } - } - }); - } - } - }, - actions: { - setSettingsAction: function setSettingsAction(context, settings) { - context.commit('setSettings', settings); - }, - setAvailableTaxAction: function setAvailableTaxAction(context, availableTax) { - context.commit('setAvailableTax', availableTax); - }, - setCartDataAction: function setCartDataAction(context, cartdata) { - context.commit('setCartData', cartdata); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - addToCartAction: function addToCartAction(context, product) { - context.commit('addToCartItem', product); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - removeCartItemAction: function removeCartItemAction(context, itemKey) { - context.commit('removeCartItem', itemKey); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - addItemQuantityAction: function addItemQuantityAction(context, itemKey) { - context.commit('addCartItemQuantity', itemKey); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - removeItemQuantityAction: function removeItemQuantityAction(context, itemKey) { - context.commit('removeCartItemQuantity', itemKey); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - toggleEditQuantityAction: function toggleEditQuantityAction(context, itemKey) { - context.commit('toggleEditQuantity', itemKey); - }, - addDiscountAction: function addDiscountAction(context, discountData) { - context.commit('addDiscount', discountData); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - addFeeAction: function addFeeAction(context, feeData) { - context.commit('addFee', feeData); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - removeFeeLineItemsAction: function removeFeeLineItemsAction(context, itemKey) { - context.commit('removeFeeLineItems', itemKey); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - saveFeeValueAction: function saveFeeValueAction(context, feeData) { - context.commit('saveFeeValue', feeData); - context.commit('calculateDiscount', context.getters); - context.commit('calculateFee', context.getters); - }, - editFeeValueAction: function editFeeValueAction(context, itemKey) { - context.commit('editFeeValue', itemKey); - }, - cancelSaveFeeValueAction: function cancelSaveFeeValueAction(context, itemKey) { - context.commit('cancelSaveFeeValue', itemKey); - }, - emptyCartAction: function emptyCartAction(context) { - context.commit('emptyCart'); - }, - calculateDiscount: function calculateDiscount(context) { - context.commit('calculateDiscount', context.getters); - }, - calculateFee: function calculateFee(context) { - context.commit('calculateFee', context.getters); - } - } -}; - -/***/ }), -/* 31 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - hasStock: function hasStock(product) { - var productCartQty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - - if (!product.manage_stock) { - return 'outofstock' == product.stock_status ? false : true; - } else { - if (product.backorders_allowed) { - return true; - } else { - return product.stock_quantity > productCartQty; - } - } - } -}; - -/***/ }), -/* 32 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.default = { - namespaced: true, - state: { - orderdata: { - billing: {}, - shipping: {}, - customer_id: 0, - customer_note: '', - payment_method: '', - payment_method_title: '' - }, - canProcessPayment: false - }, - getters: { - getCanProcessPayment: function getCanProcessPayment(state) { - return state.canProcessPayment; - } - }, - mutations: { - setOrderData: function setOrderData(state, orderdata) { - if (weLo_.isEmpty(orderdata)) { - state.orderdata = { - billing: {}, - shipping: {}, - customer_id: 0, - customer_note: '', - payment_method: '', - payment_method_title: '' - }; - } else { - state.orderdata = orderdata; - } - }, - setCustomer: function setCustomer(state, customer) { - if (Object.keys(customer).length > 0) { - state.orderdata.billing = customer.billing; - state.orderdata.shipping = customer.shipping; - state.orderdata.customer_id = customer.id; - } else { - state.orderdata.billing = {}; - state.orderdata.shipping = {}; - state.orderdata.customer_id = 0; - } - }, - emptyOrderdata: function emptyOrderdata(state) { - state.orderdata = { - billing: {}, - shipping: {}, - customer_id: 0, - customer_note: '', - payment_method: '', - payment_method_title: '' - }; - }, - setCustomerNote: function setCustomerNote(state, note) { - state.orderdata.customer_note = note.trim(); - }, - removeCustomerNote: function removeCustomerNote(state) { - state.orderdata.customer_note = ''; - }, - setGateway: function setGateway(state, gateway) { - state.orderdata.payment_method = gateway.id; - state.orderdata.payment_method_title = gateway.title; - }, - setCanProcessPayment: function setCanProcessPayment(state, canProcessPayment) { - state.canProcessPayment = canProcessPayment; - } - }, - actions: { - setOrderDataAction: function setOrderDataAction(context, orderdata) { - context.commit('setOrderData', orderdata); - }, - setCustomerAction: function setCustomerAction(context, customer) { - context.commit('setCustomer', customer); - }, - emptyOrderdataAction: function emptyOrderdataAction(context) { - context.commit('emptyOrderdata'); - }, - setCustomerNoteAction: function setCustomerNoteAction(context, note) { - context.commit('setCustomerNote', note); - }, - removeCustomerNoteAction: function removeCustomerNoteAction(context) { - context.commit('removeCustomerNote'); - }, - setGatewayAction: function setGatewayAction(context, gateway) { - context.commit('setGateway', gateway); - }, - setCanProcessPaymentAction: function setCanProcessPaymentAction(context, canProcessPayment) { - context.commit('setCanProcessPayment', canProcessPayment); - } - } -}; - -/***/ }), -/* 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 */, -/* 64 */, -/* 65 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -// -// -// -// -// -// - - -/* harmony default export */ __webpack_exports__["a"] = ({ - name: 'App' -}); - -/***/ }), -/* 66 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ 104: +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Overlay_vue__ = __webpack_require__(152); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ProductSearch_vue__ = __webpack_require__(155); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__CustomerSearch_vue__ = __webpack_require__(158); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__FeeKeypad_vue__ = __webpack_require__(161); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_mugen_scroll__ = __webpack_require__(74); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Overlay_vue__ = __webpack_require__(228); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__ProductSearch_vue__ = __webpack_require__(231); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__CustomerSearch_vue__ = __webpack_require__(234); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__FeeKeypad_vue__ = __webpack_require__(237); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_mugen_scroll__ = __webpack_require__(112); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4_vue_mugen_scroll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4_vue_mugen_scroll__); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__PrintReceipt_vue__ = __webpack_require__(168); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__PrintReceiptHtml_vue__ = __webpack_require__(171); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__CustomerNote_vue__ = __webpack_require__(174); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__PrintReceipt_vue__ = __webpack_require__(244); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__PrintReceiptHtml_vue__ = __webpack_require__(247); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__CustomerNote_vue__ = __webpack_require__(250); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__PrintRawReceipt_vue__ = __webpack_require__(586); // // // @@ -1090,6 +584,8 @@ exports.default = { // // // +// + @@ -1108,6 +604,7 @@ let Modal = wepos_get_lib('Modal'); name: 'Home', components: { + PrintRawReceipt: __WEBPACK_IMPORTED_MODULE_8__PrintRawReceipt_vue__["a" /* default */], ProductSearch: __WEBPACK_IMPORTED_MODULE_1__ProductSearch_vue__["a" /* default */], CustomerSearch: __WEBPACK_IMPORTED_MODULE_2__CustomerSearch_vue__["a" /* default */], Overlay: __WEBPACK_IMPORTED_MODULE_0__Overlay_vue__["a" /* default */], @@ -1668,7 +1165,8 @@ let Modal = wepos_get_lib('Modal'); }); /***/ }), -/* 67 */ + +/***/ 105: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1688,12 +1186,13 @@ let Modal = wepos_get_lib('Modal'); }); /***/ }), -/* 68 */ + +/***/ 106: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__KeyboardControl_vue__ = __webpack_require__(69); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_v_hotkey__ = __webpack_require__(28); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__KeyboardControl_vue__ = __webpack_require__(107); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_v_hotkey__ = __webpack_require__(51); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_v_hotkey___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_v_hotkey__); // // @@ -1990,14 +1489,15 @@ let Modal = wepos_get_lib('Modal'); }); /***/ }), -/* 69 */ + +/***/ 107: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_KeyboardControl_vue__ = __webpack_require__(70); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_KeyboardControl_vue__ = __webpack_require__(108); /* unused harmony namespace reexport */ var disposed = false -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -2041,7 +1541,8 @@ if (false) {(function () { /***/ }), -/* 70 */ + +/***/ 108: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2121,11 +1622,12 @@ if (false) {(function () { }); /***/ }), -/* 71 */ + +/***/ 109: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__KeyboardControl_vue__ = __webpack_require__(69); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__KeyboardControl_vue__ = __webpack_require__(107); // // // @@ -2507,11 +2009,12 @@ let Modal = wepos_get_lib('Modal'); }); /***/ }), -/* 72 */ + +/***/ 110: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Keyboard_vue__ = __webpack_require__(163); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Keyboard_vue__ = __webpack_require__(239); // // // @@ -2630,7 +2133,8 @@ let Modal = wepos_get_lib('Modal'); }); /***/ }), -/* 73 */ + +/***/ 111: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2823,11 +2327,13 @@ const Tokens = { }); /***/ }), -/* 74 */, -/* 75 */ + +/***/ 113: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_qz_tray__ = __webpack_require__(307); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_qz_tray___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_qz_tray__); // // // @@ -2839,22 +2345,39 @@ const Tokens = { // + /* harmony default export */ __webpack_exports__["a"] = ({ name: 'ReceiptPrint', methods: { printReceipt() { - var self = this; - - setTimeout(() => { - window.print(); - }, 500); + // var self = this; + // + // setTimeout( () => { + // window.print(); + // }, 500); + + __WEBPACK_IMPORTED_MODULE_0_qz_tray___default.a.websocket.connect().then(async function () { + const config = __WEBPACK_IMPORTED_MODULE_0_qz_tray___default.a.configs.create((await __WEBPACK_IMPORTED_MODULE_0_qz_tray___default.a.printers.getDefault()), { + margins: { left: 0.1, bottom: 0.1 } + }); + const data = [{ + type: 'pixel', + format: 'html', + flavor: 'plain', // or 'plain' if the data is raw HTML + data: document.getElementsByClassName('wepos-checkout-print-wrapper')[0].innerHTML + }]; + __WEBPACK_IMPORTED_MODULE_0_qz_tray___default.a.print(config, data).catch(function (e) { + console.error(e); + }); + }); } } }); /***/ }), -/* 76 */ + +/***/ 114: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2967,7 +2490,8 @@ const Tokens = { }); /***/ }), -/* 77 */ + +/***/ 115: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3024,88 +2548,22 @@ const Tokens = { }); /***/ }), -/* 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 */ + +/***/ 221: /***/ (function(module, exports, __webpack_require__) { "use strict"; -var _App = __webpack_require__(146); +var _App = __webpack_require__(222); var _App2 = _interopRequireDefault(_App); -var _router = __webpack_require__(149); +var _router = __webpack_require__(225); var _router2 = _interopRequireDefault(_router); -var _store = __webpack_require__(29); +var _store = __webpack_require__(52); var _store2 = _interopRequireDefault(_store); @@ -3130,20 +2588,21 @@ new Vue({ }); /***/ }), -/* 146 */ + +/***/ 222: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_App_vue__ = __webpack_require__(65); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_App_vue__ = __webpack_require__(103); /* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_152fd186_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_App_vue__ = __webpack_require__(148); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_152fd186_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_App_vue__ = __webpack_require__(224); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(147) + __webpack_require__(223) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -3187,13 +2646,15 @@ if (false) {(function () { /***/ }), -/* 147 */ + +/***/ 223: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 148 */ + +/***/ 224: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3220,7 +2681,8 @@ if (false) { } /***/ }), -/* 149 */ + +/***/ 225: /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -3230,7 +2692,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); -var _Home = __webpack_require__(150); +var _Home = __webpack_require__(226); var _Home2 = _interopRequireDefault(_Home); @@ -3250,20 +2712,21 @@ exports.default = new Router({ }); /***/ }), -/* 150 */ + +/***/ 226: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Home_vue__ = __webpack_require__(66); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Home_vue__ = __webpack_require__(104); /* empty harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_76253014_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Home_vue__ = __webpack_require__(177); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_76253014_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Home_vue__ = __webpack_require__(253); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(151) + __webpack_require__(227) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -3307,25 +2770,27 @@ if (false) {(function () { /***/ }), -/* 151 */ + +/***/ 227: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 152 */ + +/***/ 228: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Overlay_vue__ = __webpack_require__(67); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Overlay_vue__ = __webpack_require__(105); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_7b9b24aa_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Overlay_vue__ = __webpack_require__(154); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_7b9b24aa_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Overlay_vue__ = __webpack_require__(230); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(153) + __webpack_require__(229) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -3369,13 +2834,15 @@ if (false) {(function () { /***/ }), -/* 153 */ + +/***/ 229: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 154 */ + +/***/ 230: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3397,19 +2864,20 @@ if (false) { } /***/ }), -/* 155 */ + +/***/ 231: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ProductSearch_vue__ = __webpack_require__(68); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_ProductSearch_vue__ = __webpack_require__(106); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_64fc4f12_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_ProductSearch_vue__ = __webpack_require__(157); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_64fc4f12_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_ProductSearch_vue__ = __webpack_require__(233); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(156) + __webpack_require__(232) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -3453,13 +2921,15 @@ if (false) {(function () { /***/ }), -/* 156 */ + +/***/ 232: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 157 */ + +/***/ 233: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3907,19 +3377,20 @@ if (false) { } /***/ }), -/* 158 */ + +/***/ 234: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_CustomerSearch_vue__ = __webpack_require__(71); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_CustomerSearch_vue__ = __webpack_require__(109); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_414ef29b_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_CustomerSearch_vue__ = __webpack_require__(160); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_414ef29b_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_CustomerSearch_vue__ = __webpack_require__(236); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(159) + __webpack_require__(235) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -3963,13 +3434,15 @@ if (false) {(function () { /***/ }), -/* 159 */ + +/***/ 235: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 160 */ + +/***/ 236: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4819,19 +4292,20 @@ if (false) { } /***/ }), -/* 161 */ + +/***/ 237: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_FeeKeypad_vue__ = __webpack_require__(72); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_FeeKeypad_vue__ = __webpack_require__(110); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_0bc4dc95_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_FeeKeypad_vue__ = __webpack_require__(166); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_0bc4dc95_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_FeeKeypad_vue__ = __webpack_require__(242); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(162) + __webpack_require__(238) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -4875,25 +4349,27 @@ if (false) {(function () { /***/ }), -/* 162 */ + +/***/ 238: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 163 */ + +/***/ 239: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Keyboard_vue__ = __webpack_require__(73); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_Keyboard_vue__ = __webpack_require__(111); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_fbb6d6c8_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Keyboard_vue__ = __webpack_require__(165); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_fbb6d6c8_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_Keyboard_vue__ = __webpack_require__(241); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(164) + __webpack_require__(240) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -4937,13 +4413,15 @@ if (false) {(function () { /***/ }), -/* 164 */ + +/***/ 240: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 165 */ + +/***/ 241: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5009,7 +4487,8 @@ if (false) { } /***/ }), -/* 166 */ + +/***/ 242: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5113,20 +4592,20 @@ if (false) { } /***/ }), -/* 167 */, -/* 168 */ + +/***/ 244: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_PrintReceipt_vue__ = __webpack_require__(75); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_PrintReceipt_vue__ = __webpack_require__(113); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_11ba6300_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_PrintReceipt_vue__ = __webpack_require__(170); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_11ba6300_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_PrintReceipt_vue__ = __webpack_require__(246); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(169) + __webpack_require__(245) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -5170,13 +4649,15 @@ if (false) {(function () { /***/ }), -/* 169 */ + +/***/ 245: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 170 */ + +/***/ 246: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5218,19 +4699,20 @@ if (false) { } /***/ }), -/* 171 */ + +/***/ 247: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_PrintReceiptHtml_vue__ = __webpack_require__(76); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_PrintReceiptHtml_vue__ = __webpack_require__(114); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2db58d4b_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_PrintReceiptHtml_vue__ = __webpack_require__(173); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_2db58d4b_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_PrintReceiptHtml_vue__ = __webpack_require__(249); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(172) + __webpack_require__(248) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -5274,13 +4756,15 @@ if (false) {(function () { /***/ }), -/* 172 */ + +/***/ 248: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 173 */ + +/***/ 249: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5594,19 +5078,20 @@ if (false) { } /***/ }), -/* 174 */ + +/***/ 250: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_CustomerNote_vue__ = __webpack_require__(77); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_CustomerNote_vue__ = __webpack_require__(115); /* unused harmony namespace reexport */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4073e2a5_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_CustomerNote_vue__ = __webpack_require__(176); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_4073e2a5_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_CustomerNote_vue__ = __webpack_require__(252); var disposed = false function injectStyle (ssrContext) { if (disposed) return - __webpack_require__(175) + __webpack_require__(251) } -var normalizeComponent = __webpack_require__(0) +var normalizeComponent = __webpack_require__(3) /* script */ @@ -5650,13 +5135,15 @@ if (false) {(function () { /***/ }), -/* 175 */ + +/***/ 251: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }), -/* 176 */ + +/***/ 252: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -5767,7 +5254,8 @@ if (false) { } /***/ }), -/* 177 */ + +/***/ 253: /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -7647,6 +7135,10 @@ var render = function() { [ _c("print-receipt"), _vm._v(" "), + _c("PrintRawReceipt", { + attrs: { "print-data": _vm.printdata } + }), + _vm._v(" "), _c( "button", { @@ -8442,25 +7934,688 @@ var render = function() { 2 ) } -var staticRenderFns = [ - function() { - var _vm = this - var _h = _vm.$createElement - var _c = _vm._self._c || _h - return _c("td", { staticClass: "icon" }, [ - _c("span", { staticClass: "flaticon-right-arrow" }) - ]) +var staticRenderFns = [ + function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("td", { staticClass: "icon" }, [ + _c("span", { staticClass: "flaticon-right-arrow" }) + ]) + } +] +render._withStripped = true +var esExports = { render: render, staticRenderFns: staticRenderFns } +/* harmony default export */ __webpack_exports__["a"] = (esExports); +if (false) { + module.hot.accept() + if (module.hot.data) { + require("vue-hot-reload-api") .rerender("data-v-76253014", esExports) + } +} + +/***/ }), + +/***/ 52: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _Cart = __webpack_require__(53); + +var _Cart2 = _interopRequireDefault(_Cart); + +var _Order = __webpack_require__(55); + +var _Order2 = _interopRequireDefault(_Order); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var Vue = wepos_get_lib('Vue'); +var Vuex = wepos_get_lib('Vuex'); + +Vue.use(Vuex); + +exports.default = new Vuex.Store({ + modules: { + Cart: _Cart2.default, + Order: _Order2.default + } +}); + +/***/ }), + +/***/ 53: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _helper = __webpack_require__(54); + +var _helper2 = _interopRequireDefault(_helper); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = { + namespaced: true, + state: { + settings: {}, + availableTax: {}, + cartdata: { + line_items: [], + fee_lines: [] + } + }, + getters: { + getSubtotal: function getSubtotal(state) { + var subtotal = 0; + weLo_.forEach(state.cartdata.line_items, function (item, key) { + if (item.on_sale) { + subtotal += item.quantity * item.sale_price; + } else { + subtotal += item.quantity * item.regular_price; + } + }); + + return subtotal; + }, + getTotalFee: function getTotalFee(state) { + var fee = 0; + weLo_.forEach(state.cartdata.fee_lines, function (item, key) { + if (item.type == 'fee') { + fee += Math.abs(item.total); + } + }); + return fee; + }, + getTotalDiscount: function getTotalDiscount(state) { + var discount = 0; + weLo_.forEach(state.cartdata.fee_lines, function (item, key) { + if (item.type == 'discount') { + discount += Number(Math.abs(item.total)); + } + }); + + return discount; + }, + getTotalLineTax: function getTotalLineTax(state) { + var self = this, + taxLineTotal = 0; + + weLo_.forEach(state.cartdata.line_items, function (item, key) { + taxLineTotal += Math.abs(item.tax_amount * item.quantity); + }); + + return taxLineTotal; + }, + getTotalTax: function getTotalTax(state) { + var self = this, + taxLineTotal = 0, + taxFeeTotal = 0; + weLo_.forEach(state.cartdata.line_items, function (item, key) { + taxLineTotal += Math.abs(item.tax_amount * item.quantity); + }); + + if (state.settings.woo_tax != undefined && state.settings.woo_tax.wc_tax_display_cart == 'incl') { + taxLineTotal = 0; + } + + weLo_.forEach(state.cartdata.fee_lines, function (item, key) { + if (item.type == 'fee') { + if (item.tax_status == 'taxable') { + var itemTaxClass = item.tax_class === '' ? 'standard' : item.tax_class; + var taxClass = weLo_.find(state.availableTax, { 'class': itemTaxClass.toString() }); + if (taxClass !== undefined) { + taxFeeTotal += Math.abs(item.total) * Math.abs(taxClass.rate) / 100; + } + } + } + }); + + return taxLineTotal + taxFeeTotal; + }, + getOrderTotal: function getOrderTotal(state, getters) { + return getters.getSubtotal + getters.getTotalFee + getters.getTotalTax; + }, + getTotal: function getTotal(state, getters) { + return getters.getOrderTotal - getters.getTotalDiscount; + }, + getSettings: function getSettings(state, getters) { + return state.settings; + } + }, + mutations: { + setSettings: function setSettings(state, settings) { + state.settings = settings; + }, + setAvailableTax: function setAvailableTax(state, availableTax) { + state.availableTax = availableTax; + }, + setCartData: function setCartData(state, cartdata) { + if (weLo_.isEmpty(cartdata)) { + state.cartdata = { + line_items: [], + fee_lines: [] + }; + } else { + state.cartdata = Object.assign({}, cartdata); + } + }, + addToCartItem: function addToCartItem(state, product) { + var cartObject = {}; + cartObject.product_id = product.parent_id === 0 ? product.id : product.parent_id; + cartObject.name = product.name; + cartObject.quantity = 1; + cartObject.regular_price = product.regular_display_price; + cartObject.sale_price = product.sales_display_price; + cartObject.on_sale = product.on_sale; + cartObject.attribute = product.attributes; + cartObject.variation_id = product.parent_id !== 0 ? product.id : 0; + cartObject.editQuantity = false; + cartObject.type = product.type; + cartObject.tax_amount = product.tax_amount; + cartObject.manage_stock = product.manage_stock; + cartObject.stock_status = product.stock_status; + cartObject.backorders_allowed = product.backorders_allowed; + cartObject.stock_quantity = product.stock_quantity; + + var index = weLo_.findIndex(state.cartdata.line_items, { product_id: cartObject.product_id, variation_id: cartObject.variation_id }); + + if (index < 0) { + if (_helper2.default.hasStock(product)) { + state.cartdata.line_items.push(cartObject); + } + } else { + if (_helper2.default.hasStock(product, state.cartdata.line_items[index].quantity)) { + state.cartdata.line_items[index].quantity += 1; + } + } + }, + removeCartItem: function removeCartItem(state, itemKey) { + state.cartdata.line_items.splice(itemKey, 1); + }, + addCartItemQuantity: function addCartItemQuantity(state, itemKey) { + var item = state.cartdata.line_items[itemKey]; + if (_helper2.default.hasStock(item, item.quantity)) { + state.cartdata.line_items[itemKey].quantity++; + } + }, + removeCartItemQuantity: function removeCartItemQuantity(state, itemKey) { + var item = state.cartdata.line_items[itemKey]; + if (item.quantity <= 1) { + state.cartdata.line_items[itemKey].quantity = 1; + } else { + state.cartdata.line_items[itemKey].quantity--; + } + }, + toggleEditQuantity: function toggleEditQuantity(state, itemKey) { + state.cartdata.line_items[itemKey].editQuantity = !state.cartdata.line_items[itemKey].editQuantity; + }, + addDiscount: function addDiscount(state, discountData) { + state.cartdata.fee_lines.push({ + name: discountData.title, + type: 'discount', + value: discountData.value.toString(), + isEdit: false, + discount_type: discountData.type, + tax_status: 'none', + tax_class: '', + total: 0 + }); + }, + addFee: function addFee(state, feeData) { + state.cartdata.fee_lines.push({ + name: feeData.title, + type: 'fee', + value: feeData.value.toString(), + isEdit: false, + fee_type: feeData.type, + tax_status: 'none', + tax_class: '', + total: 0 + }); + }, + saveFeeValue: function saveFeeValue(state, item) { + state.cartdata.fee_lines.splice(item.key, 1, item.feeData); + state.cartdata.fee_lines[item.key].isEdit = false; + }, + editFeeValue: function editFeeValue(state, itemKey) { + state.cartdata.fee_lines[itemKey].isEdit = true; + }, + cancelSaveFeeValue: function cancelSaveFeeValue(state, itemKey) { + state.cartdata.fee_lines[itemKey].isEdit = false; + }, + removeFeeLineItems: function removeFeeLineItems(state, itemKey) { + state.cartdata.fee_lines.splice(itemKey, 1); + }, + emptyCart: function emptyCart(state) { + state.cartdata = { + line_items: [], + fee_lines: [] + }; + }, + calculateDiscount: function calculateDiscount(state, payload) { + if (state.cartdata.fee_lines.length > 0) { + weLo_.forEach(state.cartdata.fee_lines, function (item, key) { + if (item.type == "discount") { + if (item.discount_type == 'percent') { + state.cartdata.fee_lines[key].total = '-' + payload.getSubtotal * Math.abs(item.value) / 100; + } else { + state.cartdata.fee_lines[key].total = '-' + Math.abs(item.value); + } + } + }); + } + }, + calculateFee: function calculateFee(state, payload) { + if (state.cartdata.fee_lines.length > 0) { + weLo_.forEach(state.cartdata.fee_lines, function (item, key) { + if (item.type == 'fee') { + if (item.fee_type == 'percent') { + state.cartdata.fee_lines[key].total = (payload.getSubtotal * Math.abs(item.value) / 100).toString(); + } else { + state.cartdata.fee_lines[key].total = Math.abs(item.value).toString(); + } + } + }); + } + } + }, + actions: { + setSettingsAction: function setSettingsAction(context, settings) { + context.commit('setSettings', settings); + }, + setAvailableTaxAction: function setAvailableTaxAction(context, availableTax) { + context.commit('setAvailableTax', availableTax); + }, + setCartDataAction: function setCartDataAction(context, cartdata) { + context.commit('setCartData', cartdata); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + addToCartAction: function addToCartAction(context, product) { + context.commit('addToCartItem', product); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + removeCartItemAction: function removeCartItemAction(context, itemKey) { + context.commit('removeCartItem', itemKey); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + addItemQuantityAction: function addItemQuantityAction(context, itemKey) { + context.commit('addCartItemQuantity', itemKey); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + removeItemQuantityAction: function removeItemQuantityAction(context, itemKey) { + context.commit('removeCartItemQuantity', itemKey); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + toggleEditQuantityAction: function toggleEditQuantityAction(context, itemKey) { + context.commit('toggleEditQuantity', itemKey); + }, + addDiscountAction: function addDiscountAction(context, discountData) { + context.commit('addDiscount', discountData); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + addFeeAction: function addFeeAction(context, feeData) { + context.commit('addFee', feeData); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + removeFeeLineItemsAction: function removeFeeLineItemsAction(context, itemKey) { + context.commit('removeFeeLineItems', itemKey); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + saveFeeValueAction: function saveFeeValueAction(context, feeData) { + context.commit('saveFeeValue', feeData); + context.commit('calculateDiscount', context.getters); + context.commit('calculateFee', context.getters); + }, + editFeeValueAction: function editFeeValueAction(context, itemKey) { + context.commit('editFeeValue', itemKey); + }, + cancelSaveFeeValueAction: function cancelSaveFeeValueAction(context, itemKey) { + context.commit('cancelSaveFeeValue', itemKey); + }, + emptyCartAction: function emptyCartAction(context) { + context.commit('emptyCart'); + }, + calculateDiscount: function calculateDiscount(context) { + context.commit('calculateDiscount', context.getters); + }, + calculateFee: function calculateFee(context) { + context.commit('calculateFee', context.getters); + } + } +}; + +/***/ }), + +/***/ 54: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + hasStock: function hasStock(product) { + var productCartQty = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (!product.manage_stock) { + return 'outofstock' == product.stock_status ? false : true; + } else { + if (product.backorders_allowed) { + return true; + } else { + return product.stock_quantity > productCartQty; + } + } + } +}; + +/***/ }), + +/***/ 55: +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = { + namespaced: true, + state: { + orderdata: { + billing: {}, + shipping: {}, + customer_id: 0, + customer_note: '', + payment_method: '', + payment_method_title: '' + }, + canProcessPayment: false + }, + getters: { + getCanProcessPayment: function getCanProcessPayment(state) { + return state.canProcessPayment; + } + }, + mutations: { + setOrderData: function setOrderData(state, orderdata) { + if (weLo_.isEmpty(orderdata)) { + state.orderdata = { + billing: {}, + shipping: {}, + customer_id: 0, + customer_note: '', + payment_method: '', + payment_method_title: '' + }; + } else { + state.orderdata = orderdata; + } + }, + setCustomer: function setCustomer(state, customer) { + if (Object.keys(customer).length > 0) { + state.orderdata.billing = customer.billing; + state.orderdata.shipping = customer.shipping; + state.orderdata.customer_id = customer.id; + } else { + state.orderdata.billing = {}; + state.orderdata.shipping = {}; + state.orderdata.customer_id = 0; + } + }, + emptyOrderdata: function emptyOrderdata(state) { + state.orderdata = { + billing: {}, + shipping: {}, + customer_id: 0, + customer_note: '', + payment_method: '', + payment_method_title: '' + }; + }, + setCustomerNote: function setCustomerNote(state, note) { + state.orderdata.customer_note = note.trim(); + }, + removeCustomerNote: function removeCustomerNote(state) { + state.orderdata.customer_note = ''; + }, + setGateway: function setGateway(state, gateway) { + state.orderdata.payment_method = gateway.id; + state.orderdata.payment_method_title = gateway.title; + }, + setCanProcessPayment: function setCanProcessPayment(state, canProcessPayment) { + state.canProcessPayment = canProcessPayment; + } + }, + actions: { + setOrderDataAction: function setOrderDataAction(context, orderdata) { + context.commit('setOrderData', orderdata); + }, + setCustomerAction: function setCustomerAction(context, customer) { + context.commit('setCustomer', customer); + }, + emptyOrderdataAction: function emptyOrderdataAction(context) { + context.commit('emptyOrderdata'); + }, + setCustomerNoteAction: function setCustomerNoteAction(context, note) { + context.commit('setCustomerNote', note); + }, + removeCustomerNoteAction: function removeCustomerNoteAction(context) { + context.commit('removeCustomerNote'); + }, + setGatewayAction: function setGatewayAction(context, gateway) { + context.commit('setGateway', gateway); + }, + setCanProcessPaymentAction: function setCanProcessPaymentAction(context, canProcessPayment) { + context.commit('setCanProcessPayment', canProcessPayment); + } + } +}; + +/***/ }), + +/***/ 585: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// +// + + +/* harmony default export */ __webpack_exports__["a"] = ({ + name: 'PrintRawReceipt', + + data() { + return { + isPrinting: false + }; + }, + + props: { + printData: { + type: Object, + required: true + } + }, + + methods: { + printRawReceipt() { + this.isPrinting = true; + console.log(this.printData); + } + } +}); + +/***/ }), + +/***/ 586: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_PrintRawReceipt_vue__ = __webpack_require__(585); +/* unused harmony namespace reexport */ +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_d882f150_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_PrintRawReceipt_vue__ = __webpack_require__(588); +var disposed = false +function injectStyle (ssrContext) { + if (disposed) return + __webpack_require__(587) +} +var normalizeComponent = __webpack_require__(3) +/* script */ + + +/* template */ + +/* template functional */ +var __vue_template_functional__ = false +/* styles */ +var __vue_styles__ = injectStyle +/* scopeId */ +var __vue_scopeId__ = null +/* moduleIdentifier (server only) */ +var __vue_module_identifier__ = null +var Component = normalizeComponent( + __WEBPACK_IMPORTED_MODULE_0__babel_loader_node_modules_vue_loader_lib_selector_type_script_index_0_PrintRawReceipt_vue__["a" /* default */], + __WEBPACK_IMPORTED_MODULE_1__node_modules_vue_loader_lib_template_compiler_index_id_data_v_d882f150_hasScoped_false_buble_transforms_node_modules_vue_loader_lib_selector_type_template_index_0_PrintRawReceipt_vue__["a" /* default */], + __vue_template_functional__, + __vue_styles__, + __vue_scopeId__, + __vue_module_identifier__ +) +Component.options.__file = "assets/src/frontend/components/PrintRawReceipt.vue" + +/* hot reload */ +if (false) {(function () { + var hotAPI = require("vue-hot-reload-api") + hotAPI.install(require("vue"), false) + if (!hotAPI.compatible) return + module.hot.accept() + if (!module.hot.data) { + hotAPI.createRecord("data-v-d882f150", Component.options) + } else { + hotAPI.reload("data-v-d882f150", Component.options) } -] + module.hot.dispose(function (data) { + disposed = true + }) +})()} + +/* harmony default export */ __webpack_exports__["a"] = (Component.exports); + + +/***/ }), + +/***/ 587: +/***/ (function(module, exports) { + +// removed by extract-text-webpack-plugin + +/***/ }), + +/***/ 588: +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +var render = function() { + var _vm = this + var _h = _vm.$createElement + var _c = _vm._self._c || _h + return _c("div", { attrs: { id: "wepos-print-raw-receipt" } }, [ + _c( + "button", + { + staticClass: "print-btn", + on: { + click: function($event) { + $event.preventDefault() + _vm.printRawReceipt() + } + } + }, + [ + _c("span", { staticClass: "icon flaticon-printer" }), + _vm._v(" "), + _c("span", { staticClass: "label" }, [ + _vm._v(_vm._s(_vm.__("Print Raw", "wepos"))) + ]) + ] + ), + _vm._v(" "), + _vm.isPrinting + ? _c("div", [ + _c("div", { staticClass: "order-info" }, [ + _c("span", { staticClass: "wepos-left" }, [ + _c("strong", [ + _vm._v( + _vm._s(_vm.__("Order ID", "wepos")) + + ": #" + + _vm._s(_vm.printdata.order_id) + ) + ]) + ]), + _vm._v(" "), + _c("span", { staticClass: "wepos-right" }, [ + _c("strong", [ + _vm._v( + _vm._s(_vm.__("Order Date", "wepos")) + + ": " + + _vm._s(_vm.formatDate(_vm.printdata.order_date)) + ) + ]) + ]) + ]) + ]) + : _vm._e() + ]) +} +var staticRenderFns = [] render._withStripped = true var esExports = { render: render, staticRenderFns: staticRenderFns } /* harmony default export */ __webpack_exports__["a"] = (esExports); if (false) { module.hot.accept() if (module.hot.data) { - require("vue-hot-reload-api") .rerender("data-v-76253014", esExports) + require("vue-hot-reload-api") .rerender("data-v-d882f150", esExports) } } /***/ }) -]),[145]); \ No newline at end of file + +},[221]); \ No newline at end of file diff --git a/assets/js/style.js b/assets/js/style.js index 0a486189..06e3997d 100644 --- a/assets/js/style.js +++ b/assets/js/style.js @@ -1,10 +1,10 @@ pluginWebpack([3],{ -/***/ 392: +/***/ 560: /***/ (function(module, exports) { // removed by extract-text-webpack-plugin /***/ }) -},[392]); \ No newline at end of file +},[560]); \ No newline at end of file diff --git a/assets/js/vendor.js b/assets/js/vendor.js index 40856e81..04dfc696 100644 --- a/assets/js/vendor.js +++ b/assets/js/vendor.js @@ -98,19511 +98,21734 @@ /******/ __webpack_require__.oe = function(err) { console.error(err); throw err; }; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 214); +/******/ return __webpack_require__(__webpack_require__.s = 290); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { -/* globals __VUE_SSR_CONTEXT__ */ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} -// IMPORTANT: Do NOT use ES2015 features in this file. -// 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, - functionalTemplate, - injectStyles, - scopeId, - moduleIdentifier /* server only */ -) { - var esModule - var scriptExports = rawScriptExports = rawScriptExports || {} +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { - // ES6 modules interop - var type = typeof rawScriptExports.default - if (type === 'object' || type === 'function') { - esModule = rawScriptExports - scriptExports = rawScriptExports.default +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(2) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} - // Vue.extend constructor export interop - var options = typeof scriptExports === 'function' - ? scriptExports.options - : scriptExports +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} - // render functions - if (compiledTemplate) { - options.render = compiledTemplate.render - options.staticRenderFns = compiledTemplate.staticRenderFns - options._compiled = true - } +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) - // functional template - if (functionalTemplate) { - options.functional = true +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') } + return Buffer(arg, encodingOrOffset, length) +} - // scopedId - if (scopeId) { - options._scopeId = scopeId +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') } - - 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) - } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) } - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook - } else if (injectStyles) { - hook = injectStyles + } else { + buf.fill(0) } + return buf +} - 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 { - // for template-only hot-reload because in that case the render fn doesn't - // go through the normalizer - options._injectStyles = hook - // register for functioal component in vue file - options.render = function renderWithStyleInjection (h, context) { - hook.call(context) - return existing(h, context) - } - } +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') } + return Buffer(size) +} - return { - esModule: esModule, - exports: scriptExports, - options: options +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') } + return buffer.SlowBuffer(size) } /***/ }), -/* 1 */ +/* 2 */ /***/ (function(module, exports, __webpack_require__) { -var freeGlobal = __webpack_require__(100); - -/** Detect free variable `self`. */ -var freeSelf = typeof self == 'object' && self && self.Object === Object && self; +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ -/** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || Function('return this')(); -module.exports = root; +var base64 = __webpack_require__(310) +var ieee754 = __webpack_require__(311) +var isArray = __webpack_require__(132) -/***/ }), -/* 2 */ -/***/ (function(module, exports) { +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 /** - * Checks if `value` is classified as an `Array` object. + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array, else `false`. - * @example + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. * - * _.isArray([1, 2, 3]); - * // => true + * Due to various browser bugs, sometimes the Object implementation will be used even + * when the browser supports typed arrays. * - * _.isArray(document.body.children); - * // => false + * Note: * - * _.isArray('abc'); - * // => false + * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances, + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. * - * _.isArray(_.noop); - * // => false + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they + * get the Object implementation, which is slower but behaves correctly. */ -var isArray = Array.isArray; +Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined + ? global.TYPED_ARRAY_SUPPORT + : typedArraySupport() -module.exports = isArray; +/* + * Export kMaxLength after typed array support is determined. + */ +exports.kMaxLength = kMaxLength() +function typedArraySupport () { + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +} -/***/ }), -/* 3 */ -/***/ (function(module, exports) { +function kMaxLength () { + return Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff +} + +function createBuffer (that, length) { + if (kMaxLength() < length) { + throw new RangeError('Invalid typed array length') + } + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = new Uint8Array(length) + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + if (that === null) { + that = new Buffer(length) + } + that.length = length + } + + return that +} /** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false + * The `Uint8Array` prototype remains unmodified. */ -function isObjectLike(value) { - return value != null && typeof value == 'object'; + +function Buffer (arg, encodingOrOffset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, encodingOrOffset, length) + } + + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new Error( + 'If encoding is specified then the first argument must be a string' + ) + } + return allocUnsafe(this, arg) + } + return from(this, arg, encodingOrOffset, length) } -module.exports = isObjectLike; +Buffer.poolSize = 8192 // not used by this implementation +// TODO: Legacy, not needed anymore. Remove in next major version. +Buffer._augment = function (arr) { + arr.__proto__ = Buffer.prototype + return arr +} -/***/ }), -/* 4 */ -/***/ (function(module, exports) { +function from (that, value, encodingOrOffset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } -var g; - -// This works in non-strict mode -g = (function() { - return this; -})(); - -try { - // This works if eval is allowed (see CSP) - g = g || Function("return this")() || (1,eval)("this"); -} catch(e) { - // This works if the window reference is available - if(typeof window === "object") - g = window; -} - -// g can still be undefined, but nothing to do about it... -// We return undefined, instead of nothing here, so it's -// easier to handle this case. if(!global) { ...} - -module.exports = g; + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, encodingOrOffset, length) + } + if (typeof value === 'string') { + return fromString(that, value, encodingOrOffset) + } -/***/ }), -/* 5 */ -/***/ (function(module, exports) { + return fromObject(that, value) +} /** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(null, value, encodingOrOffset, length) } -module.exports = isObject; - +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true + }) + } +} -/***/ }), -/* 6 */ -/***/ (function(module, exports, __webpack_require__) { +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } +} -var Symbol = __webpack_require__(8), - getRawTag = __webpack_require__(251), - objectToString = __webpack_require__(252); +function alloc (that, size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(that, size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpretted as a start offset. + return typeof encoding === 'string' + ? createBuffer(that, size).fill(fill, encoding) + : createBuffer(that, size).fill(fill) + } + return createBuffer(that, size) +} -/** `Object#toString` result references. */ -var nullTag = '[object Null]', - undefinedTag = '[object Undefined]'; +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(null, size, fill, encoding) +} -/** Built-in value references. */ -var symToStringTag = Symbol ? Symbol.toStringTag : undefined; +function allocUnsafe (that, size) { + assertSize(size) + that = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + that[i] = 0 + } + } + return that +} /** - * The base implementation of `getTag` without fallbacks for buggy environments. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(null, size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. */ -function baseGetTag(value) { - if (value == null) { - return value === undefined ? undefinedTag : nullTag; - } - return (symToStringTag && symToStringTag in Object(value)) - ? getRawTag(value) - : objectToString(value); +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(null, size) } -module.exports = baseGetTag; +function fromString (that, string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('"encoding" must be a valid string encoding') + } -/***/ }), -/* 7 */ -/***/ (function(module, exports, __webpack_require__) { + var length = byteLength(string, encoding) | 0 + that = createBuffer(that, length) -var baseIsNative = __webpack_require__(250), - getValue = __webpack_require__(255); + var actual = that.write(string, encoding) -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined; + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + + return that } -module.exports = getNative; +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + that = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + that[i] = array[i] & 255 + } + return that +} +function fromArrayBuffer (that, array, byteOffset, length) { + array.byteLength // this throws if `array` is not a valid ArrayBuffer -/***/ }), -/* 8 */ -/***/ (function(module, exports, __webpack_require__) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } -var root = __webpack_require__(1); + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } -/** Built-in value references. */ -var Symbol = root.Symbol; + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { + array = new Uint8Array(array, byteOffset) + } else { + array = new Uint8Array(array, byteOffset, length) + } -module.exports = Symbol; + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + that = array + that.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + that = fromArrayLike(that, array) + } + return that +} +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + that = createBuffer(that, len) -/***/ }), -/* 9 */ -/***/ (function(module, exports) { + if (that.length === 0) { + return that + } -// shim for using process in browser -var process = module.exports = {}; + obj.copy(that, 0, 0, len) + return that + } -// cached from whatever global is present so that test runners that stub it -// don't break things. But we need to wrap it in a try catch in case it is -// wrapped in strict mode code which doesn't define any globals. It's inside a -// function because try/catches deoptimize in certain engines. + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } -var cachedSetTimeout; -var cachedClearTimeout; + if (obj.type === 'Buffer' && isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } -function defaultSetTimout() { - throw new Error('setTimeout has not been defined'); + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') } -function defaultClearTimeout () { - throw new Error('clearTimeout has not been defined'); + +function checked (length) { + // Note: cannot use `length < kMaxLength()` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= kMaxLength()) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength().toString(16) + ' bytes') + } + return length | 0 } -(function () { - try { - if (typeof setTimeout === 'function') { - cachedSetTimeout = setTimeout; - } else { - cachedSetTimeout = defaultSetTimout; - } - } catch (e) { - cachedSetTimeout = defaultSetTimout; - } - try { - if (typeof clearTimeout === 'function') { - cachedClearTimeout = clearTimeout; - } else { - cachedClearTimeout = defaultClearTimeout; - } - } catch (e) { - cachedClearTimeout = defaultClearTimeout; - } -} ()) -function runTimeout(fun) { - if (cachedSetTimeout === setTimeout) { - //normal enviroments in sane situations - return setTimeout(fun, 0); - } - // if setTimeout wasn't available but was latter defined - if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { - cachedSetTimeout = setTimeout; - return setTimeout(fun, 0); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedSetTimeout(fun, 0); - } catch(e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedSetTimeout.call(null, fun, 0); - } catch(e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error - return cachedSetTimeout.call(this, fun, 0); - } - } +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) } -function runClearTimeout(marker) { - if (cachedClearTimeout === clearTimeout) { - //normal enviroments in sane situations - return clearTimeout(marker); - } - // if clearTimeout wasn't available but was latter defined - if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { - cachedClearTimeout = clearTimeout; - return clearTimeout(marker); - } - try { - // when when somebody has screwed with setTimeout but no I.E. maddness - return cachedClearTimeout(marker); - } catch (e){ - try { - // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally - return cachedClearTimeout.call(null, marker); - } catch (e){ - // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. - // Some versions of I.E. have different rules for clearTimeout vs setTimeout - return cachedClearTimeout.call(this, marker); - } - } +Buffer.compare = function compare (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('Arguments must be Buffers') + } + if (a === b) return 0 -} -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; + var x = a.length + var y = b.length -function cleanUpNextTick() { - if (!draining || !currentQueue) { - return; - } - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 } -function drainQueue() { - if (draining) { - return; +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length } - var timeout = runTimeout(cleanUpNextTick); - draining = true; + } - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; + var buffer = Buffer.allocUnsafe(length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') } - currentQueue = null; - draining = false; - runClearTimeout(timeout); + buf.copy(buffer, pos) + pos += buf.length + } + return buffer } -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - runTimeout(drainQueue); - } -}; +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; + var len = string.length + if (len === 0) return 0 + + // Use a for loop to avoid recursion + var loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + case undefined: + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) return utf8ToBytes(string).length // assume utf8 + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } } -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; +Buffer.byteLength = byteLength -function noop() {} +function slowToString (encoding, start, end) { + var loweredCase = false -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; -process.prependListener = noop; -process.prependOnceListener = noop; + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. -process.listeners = function (name) { return [] } + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - - -/***/ }), -/* 10 */ -/***/ (function(module, exports, __webpack_require__) { - -var arrayLikeKeys = __webpack_require__(108), - baseKeys = __webpack_require__(110), - isArrayLike = __webpack_require__(48); + if (end === undefined || end > this.length) { + end = this.length + } -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) - * for more details. - * - * @static - * @since 0.1.0 - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); -} + if (end <= 0) { + return '' + } -module.exports = keys; + // Force coersion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + if (end <= start) { + return '' + } -/***/ }), -/* 11 */ -/***/ (function(module, exports, __webpack_require__) { + if (!encoding) encoding = 'utf8' -var DataView = __webpack_require__(284), - Map = __webpack_require__(38), - Promise = __webpack_require__(285), - Set = __webpack_require__(286), - WeakMap = __webpack_require__(112), - baseGetTag = __webpack_require__(6), - toSource = __webpack_require__(101); + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) -/** `Object#toString` result references. */ -var mapTag = '[object Map]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - setTag = '[object Set]', - weakMapTag = '[object WeakMap]'; + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) -var dataViewTag = '[object DataView]'; + case 'ascii': + return asciiSlice(this, start, end) -/** Used to detect maps, sets, and weakmaps. */ -var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -var getTag = baseGetTag; + case 'base64': + return base64Slice(this, start, end) -// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. -if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined, - ctorString = Ctor ? toSource(Ctor) : ''; + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: return dataViewTag; - case mapCtorString: return mapTag; - case promiseCtorString: return promiseTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true } - return result; - }; + } } -module.exports = getTag; +// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect +// Buffer instances. +Buffer.prototype._isBuffer = true +function swap (b, n, m) { + var i = b[n] + b[n] = b[m] + b[m] = i +} -/***/ }), -/* 12 */ -/***/ (function(module, exports, __webpack_require__) { +Buffer.prototype.swap16 = function swap16 () { + var len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} -var baseGetTag = __webpack_require__(6), - isObjectLike = __webpack_require__(3); +Buffer.prototype.swap32 = function swap32 () { + var len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); +Buffer.prototype.toString = function toString () { + var length = this.length | 0 + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) } -module.exports = isSymbol; +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} +Buffer.prototype.inspect = function inspect () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) str += ' ... ' + } + return '' +} -/***/ }), -/* 13 */ -/***/ (function(module, exports, __webpack_require__) { +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (!Buffer.isBuffer(target)) { + throw new TypeError('Argument must be a Buffer') + } -var isSymbol = __webpack_require__(12); + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } -/** - * Converts `value` to a string key if it's not a string or symbol. - * - * @private - * @param {*} value The value to inspect. - * @returns {string|symbol} Returns the key. - */ -function toKey(value) { - if (typeof value == 'string' || isSymbol(value)) { - return value; + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} -module.exports = toKey; + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + if (this === target) return 0 -/***/ }), -/* 14 */ -/***/ (function(module, exports, __webpack_require__) { + var x = thisEnd - thisStart + var y = end - start + var len = Math.min(x, y) -var toFinite = __webpack_require__(297); + var thisCopy = this.slice(thisStart, thisEnd) + var targetCopy = target.slice(start, end) -/** - * Converts `value` to an integer. - * - * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } - return result === result ? (remainder ? result - remainder : result) : 0; + if (x < y) return -1 + if (y < x) return 1 + return 0 } -module.exports = toInteger; +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + throw new TypeError('val must be string, number or Buffer') +} -/***/ }), -/* 15 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + var indexSize = 1 + var arrLength = arr.length + var valLength = val.length -"use strict"; -Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* WEBPACK VAR INJECTION */(function(process, global, setImmediate) {/*! - * Vue.js v2.5.13 - * (c) 2014-2017 Evan You - * Released under the MIT License. - */ -/* */ + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } -var emptyObject = Object.freeze({}); + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } -// these helpers produces better vm code in JS engines due to their -// explicitness and function inlining -function isUndef (v) { - return v === undefined || v === null -} + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } -function isDef (v) { - return v !== undefined && v !== null + return -1 } -function isTrue (v) { - return v === true +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 } -function isFalse (v) { - return v === false +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } -/** - * Check if value is primitive - */ -function isPrimitive (value) { - return ( - typeof value === 'string' || - typeof value === 'number' || - // $flow-disable-line - typeof value === 'symbol' || - typeof value === 'boolean' - ) +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } -/** - * Quick object check - this is primarily used to tell - * Objects from primitive values when we know the value - * is a JSON-compliant type. - */ -function isObject (obj) { - return obj !== null && typeof obj === 'object' -} +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } -/** - * Get the raw type string of a value e.g. [object Object] - */ -var _toString = Object.prototype.toString; + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') -function toRawType (value) { - return _toString.call(value).slice(8, -1) + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(parsed)) return i + buf[offset + i] = parsed + } + return i } -/** - * Strict object type check. Only returns true - * for plain JavaScript objects. - */ -function isPlainObject (obj) { - return _toString.call(obj) === '[object Object]' +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) } -function isRegExp (v) { - return _toString.call(v) === '[object RegExp]' +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) } -/** - * Check if val is a valid array index. - */ -function isValidArrayIndex (val) { - var n = parseFloat(String(val)); - return n >= 0 && Math.floor(n) === n && isFinite(val) +function latin1Write (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) } -/** - * Convert a value to a string that is actually rendered. - */ -function toString (val) { - return val == null - ? '' - : typeof val === 'object' - ? JSON.stringify(val, null, 2) - : String(val) +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) } -/** - * Convert a input value to a number for persistence. - * If the conversion fails, return original string. - */ -function toNumber (val) { - var n = parseFloat(val); - return isNaN(n) ? val : n +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) } -/** - * Make a map and return a function for checking if a key - * is in that map. - */ -function makeMap ( - str, - expectsLowerCase -) { - var map = Object.create(null); - var list = str.split(','); - for (var i = 0; i < list.length; i++) { - map[list[i]] = true; +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + // legacy write(string, encoding, offset, length) - remove in v0.13 + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) } - return expectsLowerCase - ? function (val) { return map[val.toLowerCase()]; } - : function (val) { return map[val]; } -} -/** - * Check if a tag is a built-in tag. - */ -var isBuiltInTag = makeMap('slot,component', true); + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining -/** - * Check if a attribute is a reserved attribute. - */ -var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } -/** - * Remove an item from an array - */ -function remove (arr, item) { - if (arr.length) { - var index = arr.indexOf(item); - if (index > -1) { - return arr.splice(index, 1) + if (!encoding) encoding = 'utf8' + + var loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + return asciiWrite(this, string, offset, length) + + case 'latin1': + case 'binary': + return latin1Write(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true } } } -/** - * Check whether the object has the property. - */ -var hasOwnProperty = Object.prototype.hasOwnProperty; -function hasOwn (obj, key) { - return hasOwnProperty.call(obj, key) +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } } -/** - * Create a cached version of a pure function. - */ -function cached (fn) { - var cache = Object.create(null); - return (function cachedFn (str) { - var hit = cache[str]; - return hit || (cache[str] = fn(str)) - }) +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } } -/** - * Camelize a hyphen-delimited string. - */ -var camelizeRE = /-(\w)/g; -var camelize = cached(function (str) { - return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) -}); +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + var res = [] -/** - * Capitalize a string. - */ -var capitalize = cached(function (str) { - return str.charAt(0).toUpperCase() + str.slice(1) -}); + var i = start + while (i < end) { + var firstByte = buf[i] + var codePoint = null + var bytesPerSequence = (firstByte > 0xEF) ? 4 + : (firstByte > 0xDF) ? 3 + : (firstByte > 0xBF) ? 2 + : 1 -/** - * Hyphenate a camelCase string. - */ -var hyphenateRE = /\B([A-Z])/g; -var hyphenate = cached(function (str) { - return str.replace(hyphenateRE, '-$1').toLowerCase() -}); + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint -/** - * Simple bind, faster than native - */ -function bind (fn, ctx) { - function boundFn (a) { - var l = arguments.length; - return l - ? l > 1 - ? fn.apply(ctx, arguments) - : fn.call(ctx, a) - : fn.call(ctx) + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence } - // record original fn length - boundFn._length = fn.length; - return boundFn + + return decodeCodePointsArray(res) } -/** - * Convert an Array-like object to a real Array. - */ -function toArray (list, start) { - start = start || 0; - var i = list.length - start; - var ret = new Array(i); - while (i--) { - ret[i] = list[i + start]; +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +var MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + var len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + var res = '' + var i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) } return ret } -/** - * Mix properties into target object. - */ -function extend (to, _from) { - for (var key in _from) { - to[key] = _from[key]; +function latin1Slice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) } - return to + return ret } -/** - * Merge an Array of Objects into a single Object. - */ -function toObject (arr) { - var res = {}; - for (var i = 0; i < arr.length; i++) { - if (arr[i]) { - extend(res, arr[i]); - } +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; ++i) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) } return res } -/** - * Perform no operation. - * Stubbing args to make Flow happy without leaving useless transpiled code - * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/) - */ -function noop (a, b, c) {} +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end -/** - * Always return false. - */ -var no = function (a, b, c) { return false; }; + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } -/** - * Return same value - */ -var identity = function (_) { return _; }; + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } -/** - * Generate a static keys string from compiler modules. - */ -function genStaticKeys (modules) { - return modules.reduce(function (keys, m) { - return keys.concat(m.staticKeys || []) - }, []).join(',') + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + return newBuf } -/** - * Check if two values are loosely equal - that is, - * if they are plain objects, do they have the same shape? +/* + * Need to make sure that buffer isn't trying to write out of bounds. */ -function looseEqual (a, b) { - if (a === b) { return true } - var isObjectA = isObject(a); - var isObjectB = isObject(b); - if (isObjectA && isObjectB) { - try { - var isArrayA = Array.isArray(a); - var isArrayB = Array.isArray(b); - if (isArrayA && isArrayB) { - return a.length === b.length && a.every(function (e, i) { - return looseEqual(e, b[i]) - }) - } else if (!isArrayA && !isArrayB) { - var keysA = Object.keys(a); - var keysB = Object.keys(b); - return keysA.length === keysB.length && keysA.every(function (key) { - return looseEqual(a[key], b[key]) - }) - } else { - /* istanbul ignore next */ - return false - } - } catch (e) { - /* istanbul ignore next */ - return false - } - } else if (!isObjectA && !isObjectB) { - return String(a) === String(b) - } else { - return false - } +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') } -function looseIndexOf (arr, val) { - for (var i = 0; i < arr.length; i++) { - if (looseEqual(arr[i], val)) { return i } +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul } - return -1 + + return val } -/** - * Ensure a function is called only once. - */ -function once (fn) { - var called = false; - return function () { - if (!called) { - called = true; - fn.apply(this, arguments); - } +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + var val = this[offset + --byteLength] + var mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul } + + return val } -var SSR_ATTR = 'data-server-rendered'; +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} -var ASSET_TYPES = [ - 'component', - 'directive', - 'filter' -]; +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} -var LIFECYCLE_HOOKS = [ - 'beforeCreate', - 'created', - 'beforeMount', - 'mounted', - 'beforeUpdate', - 'updated', - 'beforeDestroy', - 'destroyed', - 'activated', - 'deactivated', - 'errorCaptured' -]; +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} -/* */ +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) -var config = ({ - /** - * Option merge strategies (used in core/util/options) - */ - // $flow-disable-line - optionMergeStrategies: Object.create(null), + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} - /** - * Whether to suppress warnings. - */ - silent: false, +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) - /** - * Show production mode tip message on boot? - */ - productionTip: process.env.NODE_ENV !== 'production', + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} - /** - * Whether to enable devtools - */ - devtools: process.env.NODE_ENV !== 'production', +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) - /** - * Whether to record perf - */ - performance: false, + var val = this[offset] + var mul = 1 + var i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 - /** - * Error handler for watcher errors - */ - errorHandler: null, + if (val >= mul) val -= Math.pow(2, 8 * byteLength) - /** - * Warn handler for watcher warns - */ - warnHandler: null, + return val +} - /** - * Ignore certain custom elements - */ - ignoredElements: [], +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) - /** - * Custom user key aliases for v-on - */ - // $flow-disable-line - keyCodes: Object.create(null), + var i = byteLength + var mul = 1 + var val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 - /** - * Check if a tag is reserved so that it cannot be registered as a - * component. This is platform-dependent and may be overwritten. - */ - isReservedTag: no, + if (val >= mul) val -= Math.pow(2, 8 * byteLength) - /** - * Check if an attribute is reserved so that it cannot be used as a component - * prop. This is platform-dependent and may be overwritten. - */ - isReservedAttr: no, + return val +} - /** - * Check if a tag is an unknown element. - * Platform-dependent. - */ - isUnknownElement: no, +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} - /** - * Get the namespace of an element - */ - getTagNamespace: noop, +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} - /** - * Parse the real tag name for the specific platform. - */ - parsePlatformTagName: identity, +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} - /** - * Check if an attribute must be bound using property, e.g. value - * Platform-dependent. - */ - mustUseProp: no, +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) - /** - * Exposed for legacy reasons - */ - _lifecycleHooks: LIFECYCLE_HOOKS -}); + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} -/* */ +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) -/** - * Check if a string starts with $ or _ - */ -function isReserved (str) { - var c = (str + '').charCodeAt(0); - return c === 0x24 || c === 0x5F + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) } -/** - * Define a property. - */ -function def (obj, key, val, enumerable) { - Object.defineProperty(obj, key, { - value: val, - enumerable: !!enumerable, - writable: true, - configurable: true - }); +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) } -/** - * Parse simple path. - */ -var bailRE = /[^\w.$]/; -function parsePath (path) { - if (bailRE.test(path)) { - return - } - var segments = path.split('.'); - return function (obj) { - for (var i = 0; i < segments.length; i++) { - if (!obj) { return } - obj = obj[segments[i]]; - } - return obj - } +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) } -/* */ +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} -// can we use __proto__? -var hasProto = '__proto__' in {}; +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} -// Browser environment sniffing -var inBrowser = typeof window !== 'undefined'; -var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; -var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); -var UA = inBrowser && window.navigator.userAgent.toLowerCase(); -var isIE = UA && /msie|trident/.test(UA); -var isIE9 = UA && UA.indexOf('msie 9.0') > 0; -var isEdge = UA && UA.indexOf('edge/') > 0; -var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); -var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); -var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } -// Firefox has a "watch" function on Object.prototype... -var nativeWatch = ({}).watch; + var mul = 1 + var i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } -var supportsPassive = false; -if (inBrowser) { - try { - var opts = {}; - Object.defineProperty(opts, 'passive', ({ - get: function get () { - /* istanbul ignore next */ - supportsPassive = true; - } - })); // https://github.com/facebook/flow/issues/285 - window.addEventListener('test-passive', null, opts); - } catch (e) {} + return offset + byteLength } -// this needs to be lazy-evaled because vue may be required before -// vue-server-renderer can set VUE_ENV -var _isServer; -var isServerRendering = function () { - if (_isServer === undefined) { - /* istanbul ignore if */ - if (!inBrowser && typeof global !== 'undefined') { - // detect presence of vue-server-renderer and avoid - // Webpack shimming the process - _isServer = global['process'].env.VUE_ENV === 'server'; - } else { - _isServer = false; - } +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + byteLength = byteLength | 0 + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) } - return _isServer -}; -// detect devtools -var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; + var i = byteLength - 1 + var mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } -/* istanbul ignore next */ -function isNative (Ctor) { - return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) + return offset + byteLength } -var hasSymbol = - typeof Symbol !== 'undefined' && isNative(Symbol) && - typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = (value & 0xff) + return offset + 1 +} -var _Set; -/* istanbul ignore if */ // $flow-disable-line -if (typeof Set !== 'undefined' && isNative(Set)) { - // use native Set when available. - _Set = Set; -} else { - // a non-standard Set polyfill that only works with primitive keys. - _Set = (function () { - function Set () { - this.set = Object.create(null); - } - Set.prototype.has = function has (key) { - return this.set[key] === true - }; - Set.prototype.add = function add (key) { - this.set[key] = true; - }; - Set.prototype.clear = function clear () { - this.set = Object.create(null); - }; +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} - return Set; - }()); +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 } -/* */ +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} -var warn = noop; -var tip = noop; -var generateComponentTrace = (noop); // work around flow check -var formatComponentName = (noop); +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} -if (process.env.NODE_ENV !== 'production') { - var hasConsole = typeof console !== 'undefined'; - var classifyRE = /(?:^|[-_])(\w)/g; - var classify = function (str) { return str - .replace(classifyRE, function (c) { return c.toUpperCase(); }) - .replace(/[-_]/g, ''); }; +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} - warn = function (msg, vm) { - var trace = vm ? generateComponentTrace(vm) : ''; +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) + } + return offset + 4 +} - if (config.warnHandler) { - config.warnHandler.call(null, msg, vm, trace); - } else if (hasConsole && (!config.silent)) { - console.error(("[Vue warn]: " + msg + trace)); - } - }; +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) - tip = function (msg, vm) { - if (hasConsole && (!config.silent)) { - console.warn("[Vue tip]: " + msg + ( - vm ? generateComponentTrace(vm) : '' - )); - } - }; + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } - formatComponentName = function (vm, includeFile) { - if (vm.$root === vm) { - return '' - } - var options = typeof vm === 'function' && vm.cid != null - ? vm.options - : vm._isVue - ? vm.$options || vm.constructor.options - : vm || {}; - var name = options.name || options._componentTag; - var file = options.__file; - if (!name && file) { - var match = file.match(/([^/\\]+)\.vue$/); - name = match && match[1]; + var i = 0 + var mul = 1 + var sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } - return ( - (name ? ("<" + (classify(name)) + ">") : "") + - (file && includeFile !== false ? (" at " + file) : '') - ) - }; + return offset + byteLength +} - var repeat = function (str, n) { - var res = ''; - while (n) { - if (n % 2 === 1) { res += str; } - if (n > 1) { str += str; } - n >>= 1; - } - return res - }; +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1) - generateComponentTrace = function (vm) { - if (vm._isVue && vm.$parent) { - var tree = []; - var currentRecursiveSequence = 0; - while (vm) { - if (tree.length > 0) { - var last = tree[tree.length - 1]; - if (last.constructor === vm.constructor) { - currentRecursiveSequence++; - vm = vm.$parent; - continue - } else if (currentRecursiveSequence > 0) { - tree[tree.length - 1] = [last, currentRecursiveSequence]; - currentRecursiveSequence = 0; - } - } - tree.push(vm); - vm = vm.$parent; - } - return '\n\nfound in\n\n' + tree - .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) - ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") - : formatComponentName(vm))); }) - .join('\n') - } else { - return ("\n\n(found in " + (formatComponentName(vm)) + ")") - } - }; -} + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } -/* */ + var i = byteLength - 1 + var mul = 1 + var sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + return offset + byteLength +} -var uid = 0; +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} -/** - * A dep is an observable that can have multiple - * directives subscribing to it. - */ -var Dep = function Dep () { - this.id = uid++; - this.subs = []; -}; +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + } else { + objectWriteUInt16(this, value, offset, true) + } + return offset + 2 +} -Dep.prototype.addSub = function addSub (sub) { - this.subs.push(sub); -}; +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + } else { + objectWriteUInt16(this, value, offset, false) + } + return offset + 2 +} -Dep.prototype.removeSub = function removeSub (sub) { - remove(this.subs, sub); -}; +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else { + objectWriteUInt32(this, value, offset, true) + } + return offset + 4 +} -Dep.prototype.depend = function depend () { - if (Dep.target) { - Dep.target.addDep(this); +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset | 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + } else { + objectWriteUInt32(this, value, offset, false) } -}; + return offset + 4 +} -Dep.prototype.notify = function notify () { - // stabilize the subscriber list first - var subs = this.subs.slice(); - for (var i = 0, l = subs.length; i < l; i++) { - subs[i].update(); +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) } -}; + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} -// the current target watcher being evaluated. -// this is globally unique because there could be only one -// watcher being evaluated at any time. -Dep.target = null; -var targetStack = []; +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} -function pushTarget (_target) { - if (Dep.target) { targetStack.push(Dep.target); } - Dep.target = _target; +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) } -function popTarget () { - Dep.target = targetStack.pop(); +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 } -/* */ +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} -var VNode = function VNode ( - tag, - data, - children, - text, - elm, - context, - componentOptions, - asyncFactory -) { - this.tag = tag; - this.data = data; - this.children = children; - this.text = text; - this.elm = elm; - this.ns = undefined; - this.context = context; - this.fnContext = undefined; - this.fnOptions = undefined; - this.fnScopeId = undefined; - this.key = data && data.key; - this.componentOptions = componentOptions; - this.componentInstance = undefined; - this.parent = undefined; - this.raw = false; - this.isStatic = false; - this.isRootInsert = true; - this.isComment = false; - this.isCloned = false; - this.isOnce = false; - this.asyncFactory = asyncFactory; - this.asyncMeta = undefined; - this.isAsyncPlaceholder = false; -}; +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} -var prototypeAccessors = { child: { configurable: true } }; +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start -// DEPRECATED: alias for componentInstance for backwards compat. -/* istanbul ignore next */ -prototypeAccessors.child.get = function () { - return this.componentInstance -}; + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 -Object.defineProperties( VNode.prototype, prototypeAccessors ); + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') -var createEmptyVNode = function (text) { - if ( text === void 0 ) text = ''; + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } - var node = new VNode(); - node.text = text; - node.isComment = true; - return node -}; + var len = end - start + var i -function createTextVNode (val) { - return new VNode(undefined, undefined, undefined, String(val)) -} + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } -// optimized shallow clone -// used for static nodes and slot nodes because they may be reused across -// multiple renders, cloning them avoids errors when DOM manipulations rely -// on their elm reference. -function cloneVNode (vnode, deep) { - var componentOptions = vnode.componentOptions; - var cloned = new VNode( - vnode.tag, - vnode.data, - vnode.children, - vnode.text, - vnode.elm, - vnode.context, - componentOptions, - vnode.asyncFactory - ); - cloned.ns = vnode.ns; - cloned.isStatic = vnode.isStatic; - cloned.key = vnode.key; - cloned.isComment = vnode.isComment; - cloned.fnContext = vnode.fnContext; - cloned.fnOptions = vnode.fnOptions; - cloned.fnScopeId = vnode.fnScopeId; - cloned.isCloned = true; - if (deep) { - if (vnode.children) { - cloned.children = cloneVNodes(vnode.children, true); + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } } - if (componentOptions && componentOptions.children) { - componentOptions.children = cloneVNodes(componentOptions.children, true); + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + } else if (typeof val === 'number') { + val = val & 255 } - return cloned -} -function cloneVNodes (vnodes, deep) { - var len = vnodes.length; - var res = new Array(len); - for (var i = 0; i < len; i++) { - res[i] = cloneVNode(vnodes[i], deep); + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') } - return res -} -/* - * not type checking this file because flow doesn't play well with - * dynamically accessing methods on Array prototype - */ + if (end <= start) { + return this + } -var arrayProto = Array.prototype; -var arrayMethods = Object.create(arrayProto);[ - 'push', - 'pop', - 'shift', - 'unshift', - 'splice', - 'sort', - 'reverse' -].forEach(function (method) { - // cache original method - var original = arrayProto[method]; - def(arrayMethods, method, function mutator () { - var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 - var result = original.apply(this, args); - var ob = this.__ob__; - var inserted; - switch (method) { - case 'push': - case 'unshift': - inserted = args; - break - case 'splice': - inserted = args.slice(2); - break + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val } - if (inserted) { ob.observeArray(inserted); } - // notify change - ob.dep.notify(); - return result - }); -}); + } else { + var bytes = Buffer.isBuffer(val) + ? val + : utf8ToBytes(new Buffer(val, encoding).toString()) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } -/* */ + return this +} -var arrayKeys = Object.getOwnPropertyNames(arrayMethods); +// HELPER FUNCTIONS +// ================ -/** - * By default, when a reactive property is set, the new value is - * also converted to become reactive. However when passing down props, - * we don't want to force conversion because the value may be a nested value - * under a frozen data structure. Converting it would defeat the optimization. - */ -var observerState = { - shouldConvert: true -}; +var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g -/** - * Observer class that are attached to each observed - * object. Once attached, the observer converts target - * object's property keys into getter/setters that - * collect dependencies and dispatches updates. - */ -var Observer = function Observer (value) { - this.value = value; - this.dep = new Dep(); - this.vmCount = 0; - def(value, '__ob__', this); - if (Array.isArray(value)) { - var augment = hasProto - ? protoAugment - : copyAugment; - augment(value, arrayMethods, arrayKeys); - this.observeArray(value); - } else { - this.walk(value); +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' } -}; + return str +} -/** - * Walk through each property and convert them into - * getter/setters. This method should only be called when - * value type is Object. - */ -Observer.prototype.walk = function walk (obj) { - var keys = Object.keys(obj); - for (var i = 0; i < keys.length; i++) { - defineReactive(obj, keys[i], obj[keys[i]]); - } -}; +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} -/** - * Observe a list of Array items. - */ -Observer.prototype.observeArray = function observeArray (items) { - for (var i = 0, l = items.length; i < l; i++) { - observe(items[i]); - } -}; +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} -// helpers +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] -/** - * Augment an target Object or Array by intercepting - * the prototype chain using __proto__ - */ -function protoAugment (target, src, keys) { - /* eslint-disable no-proto */ - target.__proto__ = src; - /* eslint-enable no-proto */ -} + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) -/** - * Augment an target Object or Array by defining - * hidden properties. - */ -/* istanbul ignore next */ -function copyAugment (target, src, keys) { - for (var i = 0, l = keys.length; i < l; i++) { - var key = keys[i]; - def(target, key, src[key]); + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } } + + return bytes } -/** - * Attempt to create an observer instance for a value, - * returns the new observer if successfully observed, - * or the existing observer if the value already has one. - */ -function observe (value, asRootData) { - if (!isObject(value) || value instanceof VNode) { - return +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) } - var ob; - if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { - ob = value.__ob__; - } else if ( - observerState.shouldConvert && - !isServerRendering() && - (Array.isArray(value) || isPlainObject(value)) && - Object.isExtensible(value) && - !value._isVue - ) { - ob = new Observer(value); + return byteArray +} + +function utf16leToBytes (str, units) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) } - if (asRootData && ob) { - ob.vmCount++; + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] } - return ob + return i } -/** - * Define a reactive property on an Object. - */ -function defineReactive ( - obj, - key, - val, - customSetter, - shallow +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(5))) + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +/* globals __VUE_SSR_CONTEXT__ */ + +// IMPORTANT: Do NOT use ES2015 features in this file. +// 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, + functionalTemplate, + injectStyles, + scopeId, + moduleIdentifier /* server only */ ) { - var dep = new Dep(); + var esModule + var scriptExports = rawScriptExports = rawScriptExports || {} - var property = Object.getOwnPropertyDescriptor(obj, key); - if (property && property.configurable === false) { - return + // ES6 modules interop + var type = typeof rawScriptExports.default + if (type === 'object' || type === 'function') { + esModule = rawScriptExports + scriptExports = rawScriptExports.default } - // cater for pre-defined getter/setters - var getter = property && property.get; - var setter = property && property.set; + // Vue.extend constructor export interop + var options = typeof scriptExports === 'function' + ? scriptExports.options + : scriptExports - var childOb = !shallow && observe(val); - Object.defineProperty(obj, key, { - enumerable: true, - configurable: true, - get: function reactiveGetter () { - var value = getter ? getter.call(obj) : val; - if (Dep.target) { - dep.depend(); - if (childOb) { - childOb.dep.depend(); - if (Array.isArray(value)) { - dependArray(value); - } - } - } - return value - }, - set: function reactiveSetter (newVal) { - var value = getter ? getter.call(obj) : val; - /* eslint-disable no-self-compare */ - if (newVal === value || (newVal !== newVal && value !== value)) { - return + // render functions + if (compiledTemplate) { + options.render = compiledTemplate.render + options.staticRenderFns = compiledTemplate.staticRenderFns + options._compiled = true + } + + // functional template + if (functionalTemplate) { + options.functional = true + } + + // 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__ } - /* eslint-enable no-self-compare */ - if (process.env.NODE_ENV !== 'production' && customSetter) { - customSetter(); + // inject component styles + if (injectStyles) { + injectStyles.call(this, context) } - if (setter) { - setter.call(obj, newVal); - } else { - val = newVal; + // register component module identifier for async chunk inferrence + if (context && context._registeredComponents) { + context._registeredComponents.add(moduleIdentifier) } - childOb = !shallow && observe(newVal); - dep.notify(); } - }); -} - -/** - * Set a property on an object. Adds the new property and - * triggers change notification if the property doesn't - * already exist. - */ -function set (target, key, val) { - if (Array.isArray(target) && isValidArrayIndex(key)) { - target.length = Math.max(target.length, key); - target.splice(key, 1, val); - return val - } - if (key in target && !(key in Object.prototype)) { - target[key] = val; - return val + // used by ssr in case component is cached and beforeCreate + // never gets called + options._ssrRegister = hook + } else if (injectStyles) { + hook = injectStyles } - var ob = (target).__ob__; - if (target._isVue || (ob && ob.vmCount)) { - process.env.NODE_ENV !== 'production' && warn( - 'Avoid adding reactive properties to a Vue instance or its root $data ' + - 'at runtime - declare it upfront in the data option.' - ); - return val + + 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 { + // for template-only hot-reload because in that case the render fn doesn't + // go through the normalizer + options._injectStyles = hook + // register for functioal component in vue file + options.render = function renderWithStyleInjection (h, context) { + hook.call(context) + return existing(h, context) + } + } } - if (!ob) { - target[key] = val; - return val + + return { + esModule: esModule, + exports: scriptExports, + options: options } - defineReactive(ob.value, key, val); - ob.dep.notify(); - return val } -/** - * Delete a property and trigger change if necessary. - */ -function del (target, key) { - if (Array.isArray(target) && isValidArrayIndex(key)) { - target.splice(key, 1); - return + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +/* WEBPACK VAR INJECTION */(function(module) {(function (module, exports) { + 'use strict'; + + // Utils + function assert (val, msg) { + if (!val) throw new Error(msg || 'Assertion failed'); } - var ob = (target).__ob__; - if (target._isVue || (ob && ob.vmCount)) { - process.env.NODE_ENV !== 'production' && warn( - 'Avoid deleting properties on a Vue instance or its root $data ' + - '- just set it to null.' - ); - return + + // Could use `inherits` module, but don't want to move from single file + // architecture yet. + function inherits (ctor, superCtor) { + ctor.super_ = superCtor; + var TempCtor = function () {}; + TempCtor.prototype = superCtor.prototype; + ctor.prototype = new TempCtor(); + ctor.prototype.constructor = ctor; } - if (!hasOwn(target, key)) { - return + + // BN + + function BN (number, base, endian) { + if (BN.isBN(number)) { + return number; + } + + this.negative = 0; + this.words = null; + this.length = 0; + + // Reduction context + this.red = null; + + if (number !== null) { + if (base === 'le' || base === 'be') { + endian = base; + base = 10; + } + + this._init(number || 0, base || 10, endian || 'be'); + } } - delete target[key]; - if (!ob) { - return + if (typeof module === 'object') { + module.exports = BN; + } else { + exports.BN = BN; } - ob.dep.notify(); -} -/** - * Collect dependencies on array elements when the array is touched, since - * we cannot intercept array element access like property getters. - */ -function dependArray (value) { - for (var e = (void 0), i = 0, l = value.length; i < l; i++) { - e = value[i]; - e && e.__ob__ && e.__ob__.dep.depend(); - if (Array.isArray(e)) { - dependArray(e); + BN.BN = BN; + BN.wordSize = 26; + + var Buffer; + try { + if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { + Buffer = window.Buffer; + } else { + Buffer = __webpack_require__(349).Buffer; } + } catch (e) { } -} -/* */ + BN.isBN = function isBN (num) { + if (num instanceof BN) { + return true; + } -/** - * Option overwriting strategies are functions that handle - * how to merge a parent option value and a child option - * value into the final value. - */ -var strats = config.optionMergeStrategies; + return num !== null && typeof num === 'object' && + num.constructor.wordSize === BN.wordSize && Array.isArray(num.words); + }; -/** - * Options with restrictions - */ -if (process.env.NODE_ENV !== 'production') { - strats.el = strats.propsData = function (parent, child, vm, key) { - if (!vm) { - warn( - "option \"" + key + "\" can only be used during instance " + - 'creation with the `new` keyword.' - ); - } - return defaultStrat(parent, child) + BN.max = function max (left, right) { + if (left.cmp(right) > 0) return left; + return right; }; -} -/** - * Helper that recursively merges two data objects together. - */ -function mergeData (to, from) { - if (!from) { return to } - var key, toVal, fromVal; - var keys = Object.keys(from); - for (var i = 0; i < keys.length; i++) { - key = keys[i]; - toVal = to[key]; - fromVal = from[key]; - if (!hasOwn(to, key)) { - set(to, key, fromVal); - } else if (isPlainObject(toVal) && isPlainObject(fromVal)) { - mergeData(toVal, fromVal); + BN.min = function min (left, right) { + if (left.cmp(right) < 0) return left; + return right; + }; + + BN.prototype._init = function init (number, base, endian) { + if (typeof number === 'number') { + return this._initNumber(number, base, endian); } - } - return to -} -/** - * Data - */ -function mergeDataOrFn ( - parentVal, - childVal, - vm -) { - if (!vm) { - // in a Vue.extend merge, both should be functions - if (!childVal) { - return parentVal + if (typeof number === 'object') { + return this._initArray(number, base, endian); } - if (!parentVal) { - return childVal + + if (base === 'hex') { + base = 16; } - // when parentVal & childVal are both present, - // we need to return a function that returns the - // merged result of both functions... no need to - // check if parentVal is a function here because - // it has to be a function to pass previous merges. - return function mergedDataFn () { - return mergeData( - typeof childVal === 'function' ? childVal.call(this, this) : childVal, - typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal - ) + assert(base === (base | 0) && base >= 2 && base <= 36); + + number = number.toString().replace(/\s+/g, ''); + var start = 0; + if (number[0] === '-') { + start++; + this.negative = 1; } - } else { - return function mergedInstanceDataFn () { - // instance merge - var instanceData = typeof childVal === 'function' - ? childVal.call(vm, vm) - : childVal; - var defaultData = typeof parentVal === 'function' - ? parentVal.call(vm, vm) - : parentVal; - if (instanceData) { - return mergeData(instanceData, defaultData) + + if (start < number.length) { + if (base === 16) { + this._parseHex(number, start, endian); } else { - return defaultData + this._parseBase(number, base, start); + if (endian === 'le') { + this._initArray(this.toArray(), base, endian); + } } } - } -} + }; -strats.data = function ( - parentVal, - childVal, - vm -) { - if (!vm) { - if (childVal && typeof childVal !== 'function') { - process.env.NODE_ENV !== 'production' && warn( - 'The "data" option should be a function ' + - 'that returns a per-instance value in component ' + - 'definitions.', - vm - ); + BN.prototype._initNumber = function _initNumber (number, base, endian) { + if (number < 0) { + this.negative = 1; + number = -number; + } + if (number < 0x4000000) { + this.words = [ number & 0x3ffffff ]; + this.length = 1; + } else if (number < 0x10000000000000) { + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff + ]; + this.length = 2; + } else { + assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) + this.words = [ + number & 0x3ffffff, + (number / 0x4000000) & 0x3ffffff, + 1 + ]; + this.length = 3; + } - return parentVal + if (endian !== 'le') return; + + // Reverse the bytes + this._initArray(this.toArray(), base, endian); + }; + + BN.prototype._initArray = function _initArray (number, base, endian) { + // Perhaps a Uint8Array + assert(typeof number.length === 'number'); + if (number.length <= 0) { + this.words = [ 0 ]; + this.length = 1; + return this; } - return mergeDataOrFn(parentVal, childVal) - } - return mergeDataOrFn(parentVal, childVal, vm) -}; + this.length = Math.ceil(number.length / 3); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } -/** - * Hooks and props are merged as arrays. - */ -function mergeHook ( - parentVal, - childVal -) { - return childVal - ? parentVal - ? parentVal.concat(childVal) - : Array.isArray(childVal) - ? childVal - : [childVal] - : parentVal -} + var j, w; + var off = 0; + if (endian === 'be') { + for (i = number.length - 1, j = 0; i >= 0; i -= 3) { + w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } else if (endian === 'le') { + for (i = 0, j = 0; i < number.length; i += 3) { + w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); + this.words[j] |= (w << off) & 0x3ffffff; + this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; + off += 24; + if (off >= 26) { + off -= 26; + j++; + } + } + } + return this.strip(); + }; -LIFECYCLE_HOOKS.forEach(function (hook) { - strats[hook] = mergeHook; -}); + function parseHex4Bits (string, index) { + var c = string.charCodeAt(index); + // 'A' - 'F' + if (c >= 65 && c <= 70) { + return c - 55; + // 'a' - 'f' + } else if (c >= 97 && c <= 102) { + return c - 87; + // '0' - '9' + } else { + return (c - 48) & 0xf; + } + } -/** - * Assets - * - * When a vm is present (instance creation), we need to do - * a three-way merge between constructor options, instance - * options and parent options. - */ -function mergeAssets ( - parentVal, - childVal, - vm, - key -) { - var res = Object.create(parentVal || null); - if (childVal) { - process.env.NODE_ENV !== 'production' && assertObjectType(key, childVal, vm); - return extend(res, childVal) - } else { - return res + function parseHexByte (string, lowerBound, index) { + var r = parseHex4Bits(string, index); + if (index - 1 >= lowerBound) { + r |= parseHex4Bits(string, index - 1) << 4; + } + return r; } -} -ASSET_TYPES.forEach(function (type) { - strats[type + 's'] = mergeAssets; -}); + BN.prototype._parseHex = function _parseHex (number, start, endian) { + // Create possibly bigger array to ensure that it fits the number + this.length = Math.ceil((number.length - start) / 6); + this.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + this.words[i] = 0; + } -/** - * Watchers. - * - * Watchers hashes should not overwrite one - * another, so we merge them as arrays. - */ -strats.watch = function ( - parentVal, - childVal, - vm, - key -) { - // work around Firefox's Object.prototype.watch... - if (parentVal === nativeWatch) { parentVal = undefined; } - if (childVal === nativeWatch) { childVal = undefined; } - /* istanbul ignore if */ - if (!childVal) { return Object.create(parentVal || null) } - if (process.env.NODE_ENV !== 'production') { - assertObjectType(key, childVal, vm); - } - if (!parentVal) { return childVal } - var ret = {}; - extend(ret, parentVal); - for (var key$1 in childVal) { - var parent = ret[key$1]; - var child = childVal[key$1]; - if (parent && !Array.isArray(parent)) { - parent = [parent]; + // 24-bits chunks + var off = 0; + var j = 0; + + var w; + if (endian === 'be') { + for (i = number.length - 1; i >= start; i -= 2) { + w = parseHexByte(number, start, i) << off; + this.words[j] |= w & 0x3ffffff; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } + } else { + var parseLength = number.length - start; + for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) { + w = parseHexByte(number, start, i) << off; + this.words[j] |= w & 0x3ffffff; + if (off >= 18) { + off -= 18; + j += 1; + this.words[j] |= w >>> 26; + } else { + off += 8; + } + } } - ret[key$1] = parent - ? parent.concat(child) - : Array.isArray(child) ? child : [child]; - } - return ret -}; -/** - * Other object hashes. - */ -strats.props = -strats.methods = -strats.inject = -strats.computed = function ( - parentVal, - childVal, - vm, - key -) { - if (childVal && process.env.NODE_ENV !== 'production') { - assertObjectType(key, childVal, vm); - } - if (!parentVal) { return childVal } - var ret = Object.create(null); - extend(ret, parentVal); - if (childVal) { extend(ret, childVal); } - return ret -}; -strats.provide = mergeDataOrFn; + this.strip(); + }; -/** - * Default strategy. - */ -var defaultStrat = function (parentVal, childVal) { - return childVal === undefined - ? parentVal - : childVal -}; + function parseBase (str, start, end, mul) { + var r = 0; + var len = Math.min(str.length, end); + for (var i = start; i < len; i++) { + var c = str.charCodeAt(i) - 48; -/** - * Validate component names - */ -function checkComponents (options) { - for (var key in options.components) { - validateComponentName(key); - } -} + r *= mul; -function validateComponentName (name) { - if (!/^[a-zA-Z][\w-]*$/.test(name)) { - warn( - 'Invalid component name: "' + name + '". Component names ' + - 'can only contain alphanumeric characters and the hyphen, ' + - 'and must start with a letter.' - ); - } - if (isBuiltInTag(name) || config.isReservedTag(name)) { - warn( - 'Do not use built-in or reserved HTML elements as component ' + - 'id: ' + name - ); - } -} + // 'a' + if (c >= 49) { + r += c - 49 + 0xa; -/** - * Ensure all props option syntax are normalized into the - * Object-based format. - */ -function normalizeProps (options, vm) { - var props = options.props; - if (!props) { return } - var res = {}; - var i, val, name; - if (Array.isArray(props)) { - i = props.length; - while (i--) { - val = props[i]; - if (typeof val === 'string') { - name = camelize(val); - res[name] = { type: null }; - } else if (process.env.NODE_ENV !== 'production') { - warn('props must be strings when using array syntax.'); + // 'A' + } else if (c >= 17) { + r += c - 17 + 0xa; + + // '0' - '9' + } else { + r += c; } } - } else if (isPlainObject(props)) { - for (var key in props) { - val = props[key]; - name = camelize(key); - res[name] = isPlainObject(val) - ? val - : { type: val }; - } - } else if (process.env.NODE_ENV !== 'production') { - warn( - "Invalid value for option \"props\": expected an Array or an Object, " + - "but got " + (toRawType(props)) + ".", - vm - ); + return r; } - options.props = res; -} -/** - * Normalize all injections into Object-based format - */ -function normalizeInject (options, vm) { - var inject = options.inject; - if (!inject) { return } - var normalized = options.inject = {}; - if (Array.isArray(inject)) { - for (var i = 0; i < inject.length; i++) { - normalized[inject[i]] = { from: inject[i] }; - } - } else if (isPlainObject(inject)) { - for (var key in inject) { - var val = inject[key]; - normalized[key] = isPlainObject(val) - ? extend({ from: key }, val) - : { from: val }; + BN.prototype._parseBase = function _parseBase (number, base, start) { + // Initialize as zero + this.words = [ 0 ]; + this.length = 1; + + // Find length of limb in base + for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { + limbLen++; } - } else if (process.env.NODE_ENV !== 'production') { - warn( - "Invalid value for option \"inject\": expected an Array or an Object, " + - "but got " + (toRawType(inject)) + ".", - vm - ); - } -} + limbLen--; + limbPow = (limbPow / base) | 0; -/** - * Normalize raw function directives into object format. - */ -function normalizeDirectives (options) { - var dirs = options.directives; - if (dirs) { - for (var key in dirs) { - var def = dirs[key]; - if (typeof def === 'function') { - dirs[key] = { bind: def, update: def }; + var total = number.length - start; + var mod = total % limbLen; + var end = Math.min(total, total - mod) + start; + + var word = 0; + for (var i = start; i < end; i += limbLen) { + word = parseBase(number, i, i + limbLen, base); + + this.imuln(limbPow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); } } - } -} -function assertObjectType (name, value, vm) { - if (!isPlainObject(value)) { - warn( - "Invalid value for option \"" + name + "\": expected an Object, " + - "but got " + (toRawType(value)) + ".", - vm - ); - } -} - -/** - * Merge two option objects into a new one. - * Core utility used in both instantiation and inheritance. - */ -function mergeOptions ( - parent, - child, - vm -) { - if (process.env.NODE_ENV !== 'production') { - checkComponents(child); - } + if (mod !== 0) { + var pow = 1; + word = parseBase(number, i, number.length, base); - if (typeof child === 'function') { - child = child.options; - } + for (i = 0; i < mod; i++) { + pow *= base; + } - normalizeProps(child, vm); - normalizeInject(child, vm); - normalizeDirectives(child); - var extendsFrom = child.extends; - if (extendsFrom) { - parent = mergeOptions(parent, extendsFrom, vm); - } - if (child.mixins) { - for (var i = 0, l = child.mixins.length; i < l; i++) { - parent = mergeOptions(parent, child.mixins[i], vm); - } - } - var options = {}; - var key; - for (key in parent) { - mergeField(key); - } - for (key in child) { - if (!hasOwn(parent, key)) { - mergeField(key); + this.imuln(pow); + if (this.words[0] + word < 0x4000000) { + this.words[0] += word; + } else { + this._iaddn(word); + } } - } - function mergeField (key) { - var strat = strats[key] || defaultStrat; - options[key] = strat(parent[key], child[key], vm, key); - } - return options -} - -/** - * Resolve an asset. - * This function is used because child instances need access - * to assets defined in its ancestor chain. - */ -function resolveAsset ( - options, - type, - id, - warnMissing -) { - /* istanbul ignore if */ - if (typeof id !== 'string') { - return - } - var assets = options[type]; - // check local registration variations first - if (hasOwn(assets, id)) { return assets[id] } - var camelizedId = camelize(id); - if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } - var PascalCaseId = capitalize(camelizedId); - if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } - // fallback to prototype chain - var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; - if (process.env.NODE_ENV !== 'production' && warnMissing && !res) { - warn( - 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, - options - ); - } - return res -} -/* */ + this.strip(); + }; -function validateProp ( - key, - propOptions, - propsData, - vm -) { - var prop = propOptions[key]; - var absent = !hasOwn(propsData, key); - var value = propsData[key]; - // handle boolean props - if (isType(Boolean, prop.type)) { - if (absent && !hasOwn(prop, 'default')) { - value = false; - } else if (!isType(String, prop.type) && (value === '' || value === hyphenate(key))) { - value = true; + BN.prototype.copy = function copy (dest) { + dest.words = new Array(this.length); + for (var i = 0; i < this.length; i++) { + dest.words[i] = this.words[i]; } - } - // check default value - if (value === undefined) { - value = getPropDefaultValue(vm, prop, key); - // since the default value is a fresh copy, - // make sure to observe it. - var prevShouldConvert = observerState.shouldConvert; - observerState.shouldConvert = true; - observe(value); - observerState.shouldConvert = prevShouldConvert; - } - if ( - process.env.NODE_ENV !== 'production' && - // skip validation for weex recycle-list child component props - !(false && isObject(value) && ('@binding' in value)) - ) { - assertProp(prop, key, value, vm, absent); - } - return value -} + dest.length = this.length; + dest.negative = this.negative; + dest.red = this.red; + }; -/** - * Get the default value of a prop. - */ -function getPropDefaultValue (vm, prop, key) { - // no default, return undefined - if (!hasOwn(prop, 'default')) { - return undefined - } - var def = prop.default; - // warn against non-factory defaults for Object & Array - if (process.env.NODE_ENV !== 'production' && isObject(def)) { - warn( - 'Invalid default value for prop "' + key + '": ' + - 'Props with type Object/Array must use a factory function ' + - 'to return the default value.', - vm - ); - } - // the raw prop value was also undefined from previous render, - // return previous default value to avoid unnecessary watcher trigger - if (vm && vm.$options.propsData && - vm.$options.propsData[key] === undefined && - vm._props[key] !== undefined - ) { - return vm._props[key] - } - // call factory function for non-Function types - // a value is Function if its prototype is function even across different execution context - return typeof def === 'function' && getType(prop.type) !== 'Function' - ? def.call(vm) - : def -} + BN.prototype.clone = function clone () { + var r = new BN(null); + this.copy(r); + return r; + }; -/** - * Assert whether a prop is valid. - */ -function assertProp ( - prop, - name, - value, - vm, - absent -) { - if (prop.required && absent) { - warn( - 'Missing required prop: "' + name + '"', - vm - ); - return - } - if (value == null && !prop.required) { - return - } - var type = prop.type; - var valid = !type || type === true; - var expectedTypes = []; - if (type) { - if (!Array.isArray(type)) { - type = [type]; + BN.prototype._expand = function _expand (size) { + while (this.length < size) { + this.words[this.length++] = 0; } - for (var i = 0; i < type.length && !valid; i++) { - var assertedType = assertType(value, type[i]); - expectedTypes.push(assertedType.expectedType || ''); - valid = assertedType.valid; + return this; + }; + + // Remove leading `0` from `this` + BN.prototype.strip = function strip () { + while (this.length > 1 && this.words[this.length - 1] === 0) { + this.length--; } - } - if (!valid) { - warn( - "Invalid prop: type check failed for prop \"" + name + "\"." + - " Expected " + (expectedTypes.map(capitalize).join(', ')) + - ", got " + (toRawType(value)) + ".", - vm - ); - return - } - var validator = prop.validator; - if (validator) { - if (!validator(value)) { - warn( - 'Invalid prop: custom validator check failed for prop "' + name + '".', - vm - ); + return this._normSign(); + }; + + BN.prototype._normSign = function _normSign () { + // -0 = 0 + if (this.length === 1 && this.words[0] === 0) { + this.negative = 0; } - } -} + return this; + }; -var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/; + BN.prototype.inspect = function inspect () { + return (this.red ? ''; + }; -function assertType (value, type) { - var valid; - var expectedType = getType(type); - if (simpleCheckRE.test(expectedType)) { - var t = typeof value; - valid = t === expectedType.toLowerCase(); - // for primitive wrapper objects - if (!valid && t === 'object') { - valid = value instanceof type; - } - } else if (expectedType === 'Object') { - valid = isPlainObject(value); - } else if (expectedType === 'Array') { - valid = Array.isArray(value); - } else { - valid = value instanceof type; - } - return { - valid: valid, - expectedType: expectedType - } -} + /* -/** - * Use function string name to check built-in types, - * because a simple equality check will fail when running - * across different vms / iframes. - */ -function getType (fn) { - var match = fn && fn.toString().match(/^\s*function (\w+)/); - return match ? match[1] : '' -} + var zeros = []; + var groupSizes = []; + var groupBases = []; -function isType (type, fn) { - if (!Array.isArray(fn)) { - return getType(fn) === getType(type) + var s = ''; + var i = -1; + while (++i < BN.wordSize) { + zeros[i] = s; + s += '0'; } - for (var i = 0, len = fn.length; i < len; i++) { - if (getType(fn[i]) === getType(type)) { - return true + groupSizes[0] = 0; + groupSizes[1] = 0; + groupBases[0] = 0; + groupBases[1] = 0; + var base = 2 - 1; + while (++base < 36 + 1) { + var groupSize = 0; + var groupBase = 1; + while (groupBase < (1 << BN.wordSize) / base) { + groupBase *= base; + groupSize += 1; } + groupSizes[base] = groupSize; + groupBases[base] = groupBase; } - /* istanbul ignore next */ - return false -} -/* */ + */ -function handleError (err, vm, info) { - if (vm) { - var cur = vm; - while ((cur = cur.$parent)) { - var hooks = cur.$options.errorCaptured; - if (hooks) { - for (var i = 0; i < hooks.length; i++) { - try { - var capture = hooks[i].call(cur, err, vm, info) === false; - if (capture) { return } - } catch (e) { - globalHandleError(e, cur, 'errorCaptured hook'); - } + var zeros = [ + '', + '0', + '00', + '000', + '0000', + '00000', + '000000', + '0000000', + '00000000', + '000000000', + '0000000000', + '00000000000', + '000000000000', + '0000000000000', + '00000000000000', + '000000000000000', + '0000000000000000', + '00000000000000000', + '000000000000000000', + '0000000000000000000', + '00000000000000000000', + '000000000000000000000', + '0000000000000000000000', + '00000000000000000000000', + '000000000000000000000000', + '0000000000000000000000000' + ]; + + var groupSizes = [ + 0, 0, + 25, 16, 12, 11, 10, 9, 8, + 8, 7, 7, 7, 7, 6, 6, + 6, 6, 6, 6, 6, 5, 5, + 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5 + ]; + + var groupBases = [ + 0, 0, + 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, + 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, + 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, + 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, + 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 + ]; + + BN.prototype.toString = function toString (base, padding) { + base = base || 10; + padding = padding | 0 || 1; + + var out; + if (base === 16 || base === 'hex') { + out = ''; + var off = 0; + var carry = 0; + for (var i = 0; i < this.length; i++) { + var w = this.words[i]; + var word = (((w << off) | carry) & 0xffffff).toString(16); + carry = (w >>> (24 - off)) & 0xffffff; + if (carry !== 0 || i !== this.length - 1) { + out = zeros[6 - word.length] + word + out; + } else { + out = word + out; + } + off += 2; + if (off >= 26) { + off -= 26; + i--; } } + if (carry !== 0) { + out = carry.toString(16) + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; + } + + if (base === (base | 0) && base >= 2 && base <= 36) { + // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); + var groupSize = groupSizes[base]; + // var groupBase = Math.pow(base, groupSize); + var groupBase = groupBases[base]; + out = ''; + var c = this.clone(); + c.negative = 0; + while (!c.isZero()) { + var r = c.modn(groupBase).toString(base); + c = c.idivn(groupBase); + + if (!c.isZero()) { + out = zeros[groupSize - r.length] + r + out; + } else { + out = r + out; + } + } + if (this.isZero()) { + out = '0' + out; + } + while (out.length % padding !== 0) { + out = '0' + out; + } + if (this.negative !== 0) { + out = '-' + out; + } + return out; } - } - globalHandleError(err, vm, info); -} - -function globalHandleError (err, vm, info) { - if (config.errorHandler) { - try { - return config.errorHandler.call(null, err, vm, info) - } catch (e) { - logError(e, null, 'config.errorHandler'); - } - } - logError(err, vm, info); -} -function logError (err, vm, info) { - if (process.env.NODE_ENV !== 'production') { - warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); - } - /* istanbul ignore else */ - if ((inBrowser || inWeex) && typeof console !== 'undefined') { - console.error(err); + assert(false, 'Base should be between 2 and 36'); + }; + + BN.prototype.toNumber = function toNumber () { + var ret = this.words[0]; + if (this.length === 2) { + ret += this.words[1] * 0x4000000; + } else if (this.length === 3 && this.words[2] === 0x01) { + // NOTE: at this stage it is known that the top bit is set + ret += 0x10000000000000 + (this.words[1] * 0x4000000); + } else if (this.length > 2) { + assert(false, 'Number can only safely store up to 53 bits'); + } + return (this.negative !== 0) ? -ret : ret; + }; + + BN.prototype.toJSON = function toJSON () { + return this.toString(16); + }; + + BN.prototype.toBuffer = function toBuffer (endian, length) { + assert(typeof Buffer !== 'undefined'); + return this.toArrayLike(Buffer, endian, length); + }; + + BN.prototype.toArray = function toArray (endian, length) { + return this.toArrayLike(Array, endian, length); + }; + + BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { + var byteLength = this.byteLength(); + var reqLength = length || Math.max(1, byteLength); + assert(byteLength <= reqLength, 'byte array longer than desired length'); + assert(reqLength > 0, 'Requested array length <= 0'); + + this.strip(); + var littleEndian = endian === 'le'; + var res = new ArrayType(reqLength); + + var b, i; + var q = this.clone(); + if (!littleEndian) { + // Assume big-endian + for (i = 0; i < reqLength - byteLength; i++) { + res[i] = 0; + } + + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); + + res[reqLength - i - 1] = b; + } + } else { + for (i = 0; !q.isZero(); i++) { + b = q.andln(0xff); + q.iushrn(8); + + res[i] = b; + } + + for (; i < reqLength; i++) { + res[i] = 0; + } + } + + return res; + }; + + if (Math.clz32) { + BN.prototype._countBits = function _countBits (w) { + return 32 - Math.clz32(w); + }; } else { - throw err + BN.prototype._countBits = function _countBits (w) { + var t = w; + var r = 0; + if (t >= 0x1000) { + r += 13; + t >>>= 13; + } + if (t >= 0x40) { + r += 7; + t >>>= 7; + } + if (t >= 0x8) { + r += 4; + t >>>= 4; + } + if (t >= 0x02) { + r += 2; + t >>>= 2; + } + return r + t; + }; } -} -/* */ -/* globals MessageChannel */ + BN.prototype._zeroBits = function _zeroBits (w) { + // Short-cut + if (w === 0) return 26; -var callbacks = []; -var pending = false; + var t = w; + var r = 0; + if ((t & 0x1fff) === 0) { + r += 13; + t >>>= 13; + } + if ((t & 0x7f) === 0) { + r += 7; + t >>>= 7; + } + if ((t & 0xf) === 0) { + r += 4; + t >>>= 4; + } + if ((t & 0x3) === 0) { + r += 2; + t >>>= 2; + } + if ((t & 0x1) === 0) { + r++; + } + return r; + }; -function flushCallbacks () { - pending = false; - var copies = callbacks.slice(0); - callbacks.length = 0; - for (var i = 0; i < copies.length; i++) { - copies[i](); + // Return number of used bits in a BN + BN.prototype.bitLength = function bitLength () { + var w = this.words[this.length - 1]; + var hi = this._countBits(w); + return (this.length - 1) * 26 + hi; + }; + + function toBitArray (num) { + var w = new Array(num.bitLength()); + + for (var bit = 0; bit < w.length; bit++) { + var off = (bit / 26) | 0; + var wbit = bit % 26; + + w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; + } + + return w; } -} -// Here we have async deferring wrappers using both micro and macro tasks. -// In < 2.4 we used micro tasks everywhere, but there are some scenarios where -// micro tasks have too high a priority and fires in between supposedly -// sequential events (e.g. #4521, #6690) or even between bubbling of the same -// event (#6566). However, using macro tasks everywhere also has subtle problems -// when state is changed right before repaint (e.g. #6813, out-in transitions). -// Here we use micro task by default, but expose a way to force macro task when -// needed (e.g. in event handlers attached by v-on). -var microTimerFunc; -var macroTimerFunc; -var useMacroTask = false; + // Number of trailing zero bits + BN.prototype.zeroBits = function zeroBits () { + if (this.isZero()) return 0; -// Determine (macro) Task defer implementation. -// Technically setImmediate should be the ideal choice, but it's only available -// in IE. The only polyfill that consistently queues the callback after all DOM -// events triggered in the same loop is by using MessageChannel. -/* istanbul ignore if */ -if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { - macroTimerFunc = function () { - setImmediate(flushCallbacks); + var r = 0; + for (var i = 0; i < this.length; i++) { + var b = this._zeroBits(this.words[i]); + r += b; + if (b !== 26) break; + } + return r; }; -} else if (typeof MessageChannel !== 'undefined' && ( - isNative(MessageChannel) || - // PhantomJS - MessageChannel.toString() === '[object MessageChannelConstructor]' -)) { - var channel = new MessageChannel(); - var port = channel.port2; - channel.port1.onmessage = flushCallbacks; - macroTimerFunc = function () { - port.postMessage(1); + + BN.prototype.byteLength = function byteLength () { + return Math.ceil(this.bitLength() / 8); }; -} else { - /* istanbul ignore next */ - macroTimerFunc = function () { - setTimeout(flushCallbacks, 0); + + BN.prototype.toTwos = function toTwos (width) { + if (this.negative !== 0) { + return this.abs().inotn(width).iaddn(1); + } + return this.clone(); }; -} -// Determine MicroTask defer implementation. -/* istanbul ignore next, $flow-disable-line */ -if (typeof Promise !== 'undefined' && isNative(Promise)) { - var p = Promise.resolve(); - microTimerFunc = function () { - p.then(flushCallbacks); - // in problematic UIWebViews, Promise.then doesn't completely break, but - // it can get stuck in a weird state where callbacks are pushed into the - // microtask queue but the queue isn't being flushed, until the browser - // needs to do some other work, e.g. handle a timer. Therefore we can - // "force" the microtask queue to be flushed by adding an empty timer. - if (isIOS) { setTimeout(noop); } + BN.prototype.fromTwos = function fromTwos (width) { + if (this.testn(width - 1)) { + return this.notn(width).iaddn(1).ineg(); + } + return this.clone(); }; -} else { - // fallback to macro - microTimerFunc = macroTimerFunc; -} -/** - * Wrap a function so that if any code inside triggers state change, - * the changes are queued using a Task instead of a MicroTask. - */ -function withMacroTask (fn) { - return fn._withTask || (fn._withTask = function () { - useMacroTask = true; - var res = fn.apply(null, arguments); - useMacroTask = false; - return res - }) -} + BN.prototype.isNeg = function isNeg () { + return this.negative !== 0; + }; -function nextTick (cb, ctx) { - var _resolve; - callbacks.push(function () { - if (cb) { - try { - cb.call(ctx); - } catch (e) { - handleError(e, ctx, 'nextTick'); - } - } else if (_resolve) { - _resolve(ctx); + // Return negative clone of `this` + BN.prototype.neg = function neg () { + return this.clone().ineg(); + }; + + BN.prototype.ineg = function ineg () { + if (!this.isZero()) { + this.negative ^= 1; } - }); - if (!pending) { - pending = true; - if (useMacroTask) { - macroTimerFunc(); - } else { - microTimerFunc(); + + return this; + }; + + // Or `num` with `this` in-place + BN.prototype.iuor = function iuor (num) { + while (this.length < num.length) { + this.words[this.length++] = 0; } - } - // $flow-disable-line - if (!cb && typeof Promise !== 'undefined') { - return new Promise(function (resolve) { - _resolve = resolve; - }) - } -} -/* */ + for (var i = 0; i < num.length; i++) { + this.words[i] = this.words[i] | num.words[i]; + } -var mark; -var measure; + return this.strip(); + }; -if (process.env.NODE_ENV !== 'production') { - var perf = inBrowser && window.performance; - /* istanbul ignore if */ - if ( - perf && - perf.mark && - perf.measure && - perf.clearMarks && - perf.clearMeasures - ) { - mark = function (tag) { return perf.mark(tag); }; - measure = function (name, startTag, endTag) { - perf.measure(name, startTag, endTag); - perf.clearMarks(startTag); - perf.clearMarks(endTag); - perf.clearMeasures(name); - }; - } -} + BN.prototype.ior = function ior (num) { + assert((this.negative | num.negative) === 0); + return this.iuor(num); + }; -/* not type checking this file because flow doesn't play well with Proxy */ + // Or `num` with `this` + BN.prototype.or = function or (num) { + if (this.length > num.length) return this.clone().ior(num); + return num.clone().ior(this); + }; -var initProxy; + BN.prototype.uor = function uor (num) { + if (this.length > num.length) return this.clone().iuor(num); + return num.clone().iuor(this); + }; -if (process.env.NODE_ENV !== 'production') { - var allowedGlobals = makeMap( - 'Infinity,undefined,NaN,isFinite,isNaN,' + - 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + - 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' + - 'require' // for Webpack/Browserify - ); + // And `num` with `this` in-place + BN.prototype.iuand = function iuand (num) { + // b = min-length(num, this) + var b; + if (this.length > num.length) { + b = num; + } else { + b = this; + } - var warnNonPresent = function (target, key) { - warn( - "Property or method \"" + key + "\" is not defined on the instance but " + - 'referenced during render. Make sure that this property is reactive, ' + - 'either in the data option, or for class-based components, by ' + - 'initializing the property. ' + - 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', - target - ); + for (var i = 0; i < b.length; i++) { + this.words[i] = this.words[i] & num.words[i]; + } + + this.length = b.length; + + return this.strip(); }; - var hasProxy = - typeof Proxy !== 'undefined' && - Proxy.toString().match(/native code/); + BN.prototype.iand = function iand (num) { + assert((this.negative | num.negative) === 0); + return this.iuand(num); + }; - if (hasProxy) { - var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); - config.keyCodes = new Proxy(config.keyCodes, { - set: function set (target, key, value) { - if (isBuiltInModifier(key)) { - warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); - return false - } else { - target[key] = value; - return true - } - } - }); - } + // And `num` with `this` + BN.prototype.and = function and (num) { + if (this.length > num.length) return this.clone().iand(num); + return num.clone().iand(this); + }; - var hasHandler = { - has: function has (target, key) { - var has = key in target; - var isAllowed = allowedGlobals(key) || key.charAt(0) === '_'; - if (!has && !isAllowed) { - warnNonPresent(target, key); + BN.prototype.uand = function uand (num) { + if (this.length > num.length) return this.clone().iuand(num); + return num.clone().iuand(this); + }; + + // Xor `num` with `this` in-place + BN.prototype.iuxor = function iuxor (num) { + // a.length > b.length + var a; + var b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + for (var i = 0; i < b.length; i++) { + this.words[i] = a.words[i] ^ b.words[i]; + } + + if (this !== a) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; } - return has || !isAllowed } + + this.length = a.length; + + return this.strip(); }; - var getHandler = { - get: function get (target, key) { - if (typeof key === 'string' && !(key in target)) { - warnNonPresent(target, key); - } - return target[key] + BN.prototype.ixor = function ixor (num) { + assert((this.negative | num.negative) === 0); + return this.iuxor(num); + }; + + // Xor `num` with `this` + BN.prototype.xor = function xor (num) { + if (this.length > num.length) return this.clone().ixor(num); + return num.clone().ixor(this); + }; + + BN.prototype.uxor = function uxor (num) { + if (this.length > num.length) return this.clone().iuxor(num); + return num.clone().iuxor(this); + }; + + // Not ``this`` with ``width`` bitwidth + BN.prototype.inotn = function inotn (width) { + assert(typeof width === 'number' && width >= 0); + + var bytesNeeded = Math.ceil(width / 26) | 0; + var bitsLeft = width % 26; + + // Extend the buffer with leading zeroes + this._expand(bytesNeeded); + + if (bitsLeft > 0) { + bytesNeeded--; + } + + // Handle complete words + for (var i = 0; i < bytesNeeded; i++) { + this.words[i] = ~this.words[i] & 0x3ffffff; + } + + // Handle the residue + if (bitsLeft > 0) { + this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); } + + // And remove leading zeroes + return this.strip(); }; - initProxy = function initProxy (vm) { - if (hasProxy) { - // determine which proxy handler to use - var options = vm.$options; - var handlers = options.render && options.render._withStripped - ? getHandler - : hasHandler; - vm._renderProxy = new Proxy(vm, handlers); + BN.prototype.notn = function notn (width) { + return this.clone().inotn(width); + }; + + // Set `bit` of `this` + BN.prototype.setn = function setn (bit, val) { + assert(typeof bit === 'number' && bit >= 0); + + var off = (bit / 26) | 0; + var wbit = bit % 26; + + this._expand(off + 1); + + if (val) { + this.words[off] = this.words[off] | (1 << wbit); } else { - vm._renderProxy = vm; + this.words[off] = this.words[off] & ~(1 << wbit); } + + return this.strip(); }; -} -/* */ + // Add `num` to `this` in-place + BN.prototype.iadd = function iadd (num) { + var r; + + // negative + positive + if (this.negative !== 0 && num.negative === 0) { + this.negative = 0; + r = this.isub(num); + this.negative ^= 1; + return this._normSign(); + + // positive + negative + } else if (this.negative === 0 && num.negative !== 0) { + num.negative = 0; + r = this.isub(num); + num.negative = 1; + return r._normSign(); + } + + // a.length > b.length + var a, b; + if (this.length > num.length) { + a = this; + b = num; + } else { + a = num; + b = this; + } + + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) + (b.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + this.words[i] = r & 0x3ffffff; + carry = r >>> 26; + } + + this.length = a.length; + if (carry !== 0) { + this.words[this.length] = carry; + this.length++; + // Copy the rest of the words + } else if (a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } -var seenObjects = new _Set(); + return this; + }; -/** - * Recursively traverse an object to evoke all converted - * getters, so that every nested property inside the object - * is collected as a "deep" dependency. - */ -function traverse (val) { - _traverse(val, seenObjects); - seenObjects.clear(); -} + // Add `num` to `this` + BN.prototype.add = function add (num) { + var res; + if (num.negative !== 0 && this.negative === 0) { + num.negative = 0; + res = this.sub(num); + num.negative ^= 1; + return res; + } else if (num.negative === 0 && this.negative !== 0) { + this.negative = 0; + res = num.sub(this); + this.negative = 1; + return res; + } -function _traverse (val, seen) { - var i, keys; - var isA = Array.isArray(val); - if ((!isA && !isObject(val)) || Object.isFrozen(val)) { - return - } - if (val.__ob__) { - var depId = val.__ob__.dep.id; - if (seen.has(depId)) { - return + if (this.length > num.length) return this.clone().iadd(num); + + return num.clone().iadd(this); + }; + + // Subtract `num` from `this` in-place + BN.prototype.isub = function isub (num) { + // this - (-num) = this + num + if (num.negative !== 0) { + num.negative = 0; + var r = this.iadd(num); + num.negative = 1; + return r._normSign(); + + // -this - num = -(this + num) + } else if (this.negative !== 0) { + this.negative = 0; + this.iadd(num); + this.negative = 1; + return this._normSign(); + } + + // At this point both numbers are positive + var cmp = this.cmp(num); + + // Optimization - zeroify + if (cmp === 0) { + this.negative = 0; + this.length = 1; + this.words[0] = 0; + return this; } - seen.add(depId); - } - if (isA) { - i = val.length; - while (i--) { _traverse(val[i], seen); } - } else { - keys = Object.keys(val); - i = keys.length; - while (i--) { _traverse(val[keys[i]], seen); } - } -} -/* */ + // a > b + var a, b; + if (cmp > 0) { + a = this; + b = num; + } else { + a = num; + b = this; + } -var normalizeEvent = cached(function (name) { - var passive = name.charAt(0) === '&'; - name = passive ? name.slice(1) : name; - var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first - name = once$$1 ? name.slice(1) : name; - var capture = name.charAt(0) === '!'; - name = capture ? name.slice(1) : name; - return { - name: name, - once: once$$1, - capture: capture, - passive: passive - } -}); + var carry = 0; + for (var i = 0; i < b.length; i++) { + r = (a.words[i] | 0) - (b.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } + for (; carry !== 0 && i < a.length; i++) { + r = (a.words[i] | 0) + carry; + carry = r >> 26; + this.words[i] = r & 0x3ffffff; + } -function createFnInvoker (fns) { - function invoker () { - var arguments$1 = arguments; + // Copy rest of the words + if (carry === 0 && i < a.length && a !== this) { + for (; i < a.length; i++) { + this.words[i] = a.words[i]; + } + } - var fns = invoker.fns; - if (Array.isArray(fns)) { - var cloned = fns.slice(); - for (var i = 0; i < cloned.length; i++) { - cloned[i].apply(null, arguments$1); + this.length = Math.max(this.length, i); + + if (a !== this) { + this.negative = 1; + } + + return this.strip(); + }; + + // Subtract `num` from `this` + BN.prototype.sub = function sub (num) { + return this.clone().isub(num); + }; + + function smallMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + var len = (self.length + num.length) | 0; + out.length = len; + len = (len - 1) | 0; + + // Peel one iteration (compiler can't do it, because of code complexity) + var a = self.words[0] | 0; + var b = num.words[0] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + var carry = (r / 0x4000000) | 0; + out.words[0] = lo; + + for (var k = 1; k < len; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = carry >>> 26; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = (k - j) | 0; + a = self.words[i] | 0; + b = num.words[j] | 0; + r = a * b + rword; + ncarry += (r / 0x4000000) | 0; + rword = r & 0x3ffffff; } + out.words[k] = rword | 0; + carry = ncarry | 0; + } + if (carry !== 0) { + out.words[k] = carry | 0; } else { - // return handler return value for single handlers - return fns.apply(null, arguments) + out.length--; + } + + return out.strip(); + } + + // TODO(indutny): it may be reasonable to omit it for users who don't need + // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit + // multiplication (like elliptic secp256k1). + var comb10MulTo = function comb10MulTo (self, num, out) { + var a = self.words; + var b = num.words; + var o = out.words; + var c = 0; + var lo; + var mid; + var hi; + var a0 = a[0] | 0; + var al0 = a0 & 0x1fff; + var ah0 = a0 >>> 13; + var a1 = a[1] | 0; + var al1 = a1 & 0x1fff; + var ah1 = a1 >>> 13; + var a2 = a[2] | 0; + var al2 = a2 & 0x1fff; + var ah2 = a2 >>> 13; + var a3 = a[3] | 0; + var al3 = a3 & 0x1fff; + var ah3 = a3 >>> 13; + var a4 = a[4] | 0; + var al4 = a4 & 0x1fff; + var ah4 = a4 >>> 13; + var a5 = a[5] | 0; + var al5 = a5 & 0x1fff; + var ah5 = a5 >>> 13; + var a6 = a[6] | 0; + var al6 = a6 & 0x1fff; + var ah6 = a6 >>> 13; + var a7 = a[7] | 0; + var al7 = a7 & 0x1fff; + var ah7 = a7 >>> 13; + var a8 = a[8] | 0; + var al8 = a8 & 0x1fff; + var ah8 = a8 >>> 13; + var a9 = a[9] | 0; + var al9 = a9 & 0x1fff; + var ah9 = a9 >>> 13; + var b0 = b[0] | 0; + var bl0 = b0 & 0x1fff; + var bh0 = b0 >>> 13; + var b1 = b[1] | 0; + var bl1 = b1 & 0x1fff; + var bh1 = b1 >>> 13; + var b2 = b[2] | 0; + var bl2 = b2 & 0x1fff; + var bh2 = b2 >>> 13; + var b3 = b[3] | 0; + var bl3 = b3 & 0x1fff; + var bh3 = b3 >>> 13; + var b4 = b[4] | 0; + var bl4 = b4 & 0x1fff; + var bh4 = b4 >>> 13; + var b5 = b[5] | 0; + var bl5 = b5 & 0x1fff; + var bh5 = b5 >>> 13; + var b6 = b[6] | 0; + var bl6 = b6 & 0x1fff; + var bh6 = b6 >>> 13; + var b7 = b[7] | 0; + var bl7 = b7 & 0x1fff; + var bh7 = b7 >>> 13; + var b8 = b[8] | 0; + var bl8 = b8 & 0x1fff; + var bh8 = b8 >>> 13; + var b9 = b[9] | 0; + var bl9 = b9 & 0x1fff; + var bh9 = b9 >>> 13; + + out.negative = self.negative ^ num.negative; + out.length = 19; + /* k = 0 */ + lo = Math.imul(al0, bl0); + mid = Math.imul(al0, bh0); + mid = (mid + Math.imul(ah0, bl0)) | 0; + hi = Math.imul(ah0, bh0); + var w0 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w0 >>> 26)) | 0; + w0 &= 0x3ffffff; + /* k = 1 */ + lo = Math.imul(al1, bl0); + mid = Math.imul(al1, bh0); + mid = (mid + Math.imul(ah1, bl0)) | 0; + hi = Math.imul(ah1, bh0); + lo = (lo + Math.imul(al0, bl1)) | 0; + mid = (mid + Math.imul(al0, bh1)) | 0; + mid = (mid + Math.imul(ah0, bl1)) | 0; + hi = (hi + Math.imul(ah0, bh1)) | 0; + var w1 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w1 >>> 26)) | 0; + w1 &= 0x3ffffff; + /* k = 2 */ + lo = Math.imul(al2, bl0); + mid = Math.imul(al2, bh0); + mid = (mid + Math.imul(ah2, bl0)) | 0; + hi = Math.imul(ah2, bh0); + lo = (lo + Math.imul(al1, bl1)) | 0; + mid = (mid + Math.imul(al1, bh1)) | 0; + mid = (mid + Math.imul(ah1, bl1)) | 0; + hi = (hi + Math.imul(ah1, bh1)) | 0; + lo = (lo + Math.imul(al0, bl2)) | 0; + mid = (mid + Math.imul(al0, bh2)) | 0; + mid = (mid + Math.imul(ah0, bl2)) | 0; + hi = (hi + Math.imul(ah0, bh2)) | 0; + var w2 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w2 >>> 26)) | 0; + w2 &= 0x3ffffff; + /* k = 3 */ + lo = Math.imul(al3, bl0); + mid = Math.imul(al3, bh0); + mid = (mid + Math.imul(ah3, bl0)) | 0; + hi = Math.imul(ah3, bh0); + lo = (lo + Math.imul(al2, bl1)) | 0; + mid = (mid + Math.imul(al2, bh1)) | 0; + mid = (mid + Math.imul(ah2, bl1)) | 0; + hi = (hi + Math.imul(ah2, bh1)) | 0; + lo = (lo + Math.imul(al1, bl2)) | 0; + mid = (mid + Math.imul(al1, bh2)) | 0; + mid = (mid + Math.imul(ah1, bl2)) | 0; + hi = (hi + Math.imul(ah1, bh2)) | 0; + lo = (lo + Math.imul(al0, bl3)) | 0; + mid = (mid + Math.imul(al0, bh3)) | 0; + mid = (mid + Math.imul(ah0, bl3)) | 0; + hi = (hi + Math.imul(ah0, bh3)) | 0; + var w3 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w3 >>> 26)) | 0; + w3 &= 0x3ffffff; + /* k = 4 */ + lo = Math.imul(al4, bl0); + mid = Math.imul(al4, bh0); + mid = (mid + Math.imul(ah4, bl0)) | 0; + hi = Math.imul(ah4, bh0); + lo = (lo + Math.imul(al3, bl1)) | 0; + mid = (mid + Math.imul(al3, bh1)) | 0; + mid = (mid + Math.imul(ah3, bl1)) | 0; + hi = (hi + Math.imul(ah3, bh1)) | 0; + lo = (lo + Math.imul(al2, bl2)) | 0; + mid = (mid + Math.imul(al2, bh2)) | 0; + mid = (mid + Math.imul(ah2, bl2)) | 0; + hi = (hi + Math.imul(ah2, bh2)) | 0; + lo = (lo + Math.imul(al1, bl3)) | 0; + mid = (mid + Math.imul(al1, bh3)) | 0; + mid = (mid + Math.imul(ah1, bl3)) | 0; + hi = (hi + Math.imul(ah1, bh3)) | 0; + lo = (lo + Math.imul(al0, bl4)) | 0; + mid = (mid + Math.imul(al0, bh4)) | 0; + mid = (mid + Math.imul(ah0, bl4)) | 0; + hi = (hi + Math.imul(ah0, bh4)) | 0; + var w4 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w4 >>> 26)) | 0; + w4 &= 0x3ffffff; + /* k = 5 */ + lo = Math.imul(al5, bl0); + mid = Math.imul(al5, bh0); + mid = (mid + Math.imul(ah5, bl0)) | 0; + hi = Math.imul(ah5, bh0); + lo = (lo + Math.imul(al4, bl1)) | 0; + mid = (mid + Math.imul(al4, bh1)) | 0; + mid = (mid + Math.imul(ah4, bl1)) | 0; + hi = (hi + Math.imul(ah4, bh1)) | 0; + lo = (lo + Math.imul(al3, bl2)) | 0; + mid = (mid + Math.imul(al3, bh2)) | 0; + mid = (mid + Math.imul(ah3, bl2)) | 0; + hi = (hi + Math.imul(ah3, bh2)) | 0; + lo = (lo + Math.imul(al2, bl3)) | 0; + mid = (mid + Math.imul(al2, bh3)) | 0; + mid = (mid + Math.imul(ah2, bl3)) | 0; + hi = (hi + Math.imul(ah2, bh3)) | 0; + lo = (lo + Math.imul(al1, bl4)) | 0; + mid = (mid + Math.imul(al1, bh4)) | 0; + mid = (mid + Math.imul(ah1, bl4)) | 0; + hi = (hi + Math.imul(ah1, bh4)) | 0; + lo = (lo + Math.imul(al0, bl5)) | 0; + mid = (mid + Math.imul(al0, bh5)) | 0; + mid = (mid + Math.imul(ah0, bl5)) | 0; + hi = (hi + Math.imul(ah0, bh5)) | 0; + var w5 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w5 >>> 26)) | 0; + w5 &= 0x3ffffff; + /* k = 6 */ + lo = Math.imul(al6, bl0); + mid = Math.imul(al6, bh0); + mid = (mid + Math.imul(ah6, bl0)) | 0; + hi = Math.imul(ah6, bh0); + lo = (lo + Math.imul(al5, bl1)) | 0; + mid = (mid + Math.imul(al5, bh1)) | 0; + mid = (mid + Math.imul(ah5, bl1)) | 0; + hi = (hi + Math.imul(ah5, bh1)) | 0; + lo = (lo + Math.imul(al4, bl2)) | 0; + mid = (mid + Math.imul(al4, bh2)) | 0; + mid = (mid + Math.imul(ah4, bl2)) | 0; + hi = (hi + Math.imul(ah4, bh2)) | 0; + lo = (lo + Math.imul(al3, bl3)) | 0; + mid = (mid + Math.imul(al3, bh3)) | 0; + mid = (mid + Math.imul(ah3, bl3)) | 0; + hi = (hi + Math.imul(ah3, bh3)) | 0; + lo = (lo + Math.imul(al2, bl4)) | 0; + mid = (mid + Math.imul(al2, bh4)) | 0; + mid = (mid + Math.imul(ah2, bl4)) | 0; + hi = (hi + Math.imul(ah2, bh4)) | 0; + lo = (lo + Math.imul(al1, bl5)) | 0; + mid = (mid + Math.imul(al1, bh5)) | 0; + mid = (mid + Math.imul(ah1, bl5)) | 0; + hi = (hi + Math.imul(ah1, bh5)) | 0; + lo = (lo + Math.imul(al0, bl6)) | 0; + mid = (mid + Math.imul(al0, bh6)) | 0; + mid = (mid + Math.imul(ah0, bl6)) | 0; + hi = (hi + Math.imul(ah0, bh6)) | 0; + var w6 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w6 >>> 26)) | 0; + w6 &= 0x3ffffff; + /* k = 7 */ + lo = Math.imul(al7, bl0); + mid = Math.imul(al7, bh0); + mid = (mid + Math.imul(ah7, bl0)) | 0; + hi = Math.imul(ah7, bh0); + lo = (lo + Math.imul(al6, bl1)) | 0; + mid = (mid + Math.imul(al6, bh1)) | 0; + mid = (mid + Math.imul(ah6, bl1)) | 0; + hi = (hi + Math.imul(ah6, bh1)) | 0; + lo = (lo + Math.imul(al5, bl2)) | 0; + mid = (mid + Math.imul(al5, bh2)) | 0; + mid = (mid + Math.imul(ah5, bl2)) | 0; + hi = (hi + Math.imul(ah5, bh2)) | 0; + lo = (lo + Math.imul(al4, bl3)) | 0; + mid = (mid + Math.imul(al4, bh3)) | 0; + mid = (mid + Math.imul(ah4, bl3)) | 0; + hi = (hi + Math.imul(ah4, bh3)) | 0; + lo = (lo + Math.imul(al3, bl4)) | 0; + mid = (mid + Math.imul(al3, bh4)) | 0; + mid = (mid + Math.imul(ah3, bl4)) | 0; + hi = (hi + Math.imul(ah3, bh4)) | 0; + lo = (lo + Math.imul(al2, bl5)) | 0; + mid = (mid + Math.imul(al2, bh5)) | 0; + mid = (mid + Math.imul(ah2, bl5)) | 0; + hi = (hi + Math.imul(ah2, bh5)) | 0; + lo = (lo + Math.imul(al1, bl6)) | 0; + mid = (mid + Math.imul(al1, bh6)) | 0; + mid = (mid + Math.imul(ah1, bl6)) | 0; + hi = (hi + Math.imul(ah1, bh6)) | 0; + lo = (lo + Math.imul(al0, bl7)) | 0; + mid = (mid + Math.imul(al0, bh7)) | 0; + mid = (mid + Math.imul(ah0, bl7)) | 0; + hi = (hi + Math.imul(ah0, bh7)) | 0; + var w7 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w7 >>> 26)) | 0; + w7 &= 0x3ffffff; + /* k = 8 */ + lo = Math.imul(al8, bl0); + mid = Math.imul(al8, bh0); + mid = (mid + Math.imul(ah8, bl0)) | 0; + hi = Math.imul(ah8, bh0); + lo = (lo + Math.imul(al7, bl1)) | 0; + mid = (mid + Math.imul(al7, bh1)) | 0; + mid = (mid + Math.imul(ah7, bl1)) | 0; + hi = (hi + Math.imul(ah7, bh1)) | 0; + lo = (lo + Math.imul(al6, bl2)) | 0; + mid = (mid + Math.imul(al6, bh2)) | 0; + mid = (mid + Math.imul(ah6, bl2)) | 0; + hi = (hi + Math.imul(ah6, bh2)) | 0; + lo = (lo + Math.imul(al5, bl3)) | 0; + mid = (mid + Math.imul(al5, bh3)) | 0; + mid = (mid + Math.imul(ah5, bl3)) | 0; + hi = (hi + Math.imul(ah5, bh3)) | 0; + lo = (lo + Math.imul(al4, bl4)) | 0; + mid = (mid + Math.imul(al4, bh4)) | 0; + mid = (mid + Math.imul(ah4, bl4)) | 0; + hi = (hi + Math.imul(ah4, bh4)) | 0; + lo = (lo + Math.imul(al3, bl5)) | 0; + mid = (mid + Math.imul(al3, bh5)) | 0; + mid = (mid + Math.imul(ah3, bl5)) | 0; + hi = (hi + Math.imul(ah3, bh5)) | 0; + lo = (lo + Math.imul(al2, bl6)) | 0; + mid = (mid + Math.imul(al2, bh6)) | 0; + mid = (mid + Math.imul(ah2, bl6)) | 0; + hi = (hi + Math.imul(ah2, bh6)) | 0; + lo = (lo + Math.imul(al1, bl7)) | 0; + mid = (mid + Math.imul(al1, bh7)) | 0; + mid = (mid + Math.imul(ah1, bl7)) | 0; + hi = (hi + Math.imul(ah1, bh7)) | 0; + lo = (lo + Math.imul(al0, bl8)) | 0; + mid = (mid + Math.imul(al0, bh8)) | 0; + mid = (mid + Math.imul(ah0, bl8)) | 0; + hi = (hi + Math.imul(ah0, bh8)) | 0; + var w8 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w8 >>> 26)) | 0; + w8 &= 0x3ffffff; + /* k = 9 */ + lo = Math.imul(al9, bl0); + mid = Math.imul(al9, bh0); + mid = (mid + Math.imul(ah9, bl0)) | 0; + hi = Math.imul(ah9, bh0); + lo = (lo + Math.imul(al8, bl1)) | 0; + mid = (mid + Math.imul(al8, bh1)) | 0; + mid = (mid + Math.imul(ah8, bl1)) | 0; + hi = (hi + Math.imul(ah8, bh1)) | 0; + lo = (lo + Math.imul(al7, bl2)) | 0; + mid = (mid + Math.imul(al7, bh2)) | 0; + mid = (mid + Math.imul(ah7, bl2)) | 0; + hi = (hi + Math.imul(ah7, bh2)) | 0; + lo = (lo + Math.imul(al6, bl3)) | 0; + mid = (mid + Math.imul(al6, bh3)) | 0; + mid = (mid + Math.imul(ah6, bl3)) | 0; + hi = (hi + Math.imul(ah6, bh3)) | 0; + lo = (lo + Math.imul(al5, bl4)) | 0; + mid = (mid + Math.imul(al5, bh4)) | 0; + mid = (mid + Math.imul(ah5, bl4)) | 0; + hi = (hi + Math.imul(ah5, bh4)) | 0; + lo = (lo + Math.imul(al4, bl5)) | 0; + mid = (mid + Math.imul(al4, bh5)) | 0; + mid = (mid + Math.imul(ah4, bl5)) | 0; + hi = (hi + Math.imul(ah4, bh5)) | 0; + lo = (lo + Math.imul(al3, bl6)) | 0; + mid = (mid + Math.imul(al3, bh6)) | 0; + mid = (mid + Math.imul(ah3, bl6)) | 0; + hi = (hi + Math.imul(ah3, bh6)) | 0; + lo = (lo + Math.imul(al2, bl7)) | 0; + mid = (mid + Math.imul(al2, bh7)) | 0; + mid = (mid + Math.imul(ah2, bl7)) | 0; + hi = (hi + Math.imul(ah2, bh7)) | 0; + lo = (lo + Math.imul(al1, bl8)) | 0; + mid = (mid + Math.imul(al1, bh8)) | 0; + mid = (mid + Math.imul(ah1, bl8)) | 0; + hi = (hi + Math.imul(ah1, bh8)) | 0; + lo = (lo + Math.imul(al0, bl9)) | 0; + mid = (mid + Math.imul(al0, bh9)) | 0; + mid = (mid + Math.imul(ah0, bl9)) | 0; + hi = (hi + Math.imul(ah0, bh9)) | 0; + var w9 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w9 >>> 26)) | 0; + w9 &= 0x3ffffff; + /* k = 10 */ + lo = Math.imul(al9, bl1); + mid = Math.imul(al9, bh1); + mid = (mid + Math.imul(ah9, bl1)) | 0; + hi = Math.imul(ah9, bh1); + lo = (lo + Math.imul(al8, bl2)) | 0; + mid = (mid + Math.imul(al8, bh2)) | 0; + mid = (mid + Math.imul(ah8, bl2)) | 0; + hi = (hi + Math.imul(ah8, bh2)) | 0; + lo = (lo + Math.imul(al7, bl3)) | 0; + mid = (mid + Math.imul(al7, bh3)) | 0; + mid = (mid + Math.imul(ah7, bl3)) | 0; + hi = (hi + Math.imul(ah7, bh3)) | 0; + lo = (lo + Math.imul(al6, bl4)) | 0; + mid = (mid + Math.imul(al6, bh4)) | 0; + mid = (mid + Math.imul(ah6, bl4)) | 0; + hi = (hi + Math.imul(ah6, bh4)) | 0; + lo = (lo + Math.imul(al5, bl5)) | 0; + mid = (mid + Math.imul(al5, bh5)) | 0; + mid = (mid + Math.imul(ah5, bl5)) | 0; + hi = (hi + Math.imul(ah5, bh5)) | 0; + lo = (lo + Math.imul(al4, bl6)) | 0; + mid = (mid + Math.imul(al4, bh6)) | 0; + mid = (mid + Math.imul(ah4, bl6)) | 0; + hi = (hi + Math.imul(ah4, bh6)) | 0; + lo = (lo + Math.imul(al3, bl7)) | 0; + mid = (mid + Math.imul(al3, bh7)) | 0; + mid = (mid + Math.imul(ah3, bl7)) | 0; + hi = (hi + Math.imul(ah3, bh7)) | 0; + lo = (lo + Math.imul(al2, bl8)) | 0; + mid = (mid + Math.imul(al2, bh8)) | 0; + mid = (mid + Math.imul(ah2, bl8)) | 0; + hi = (hi + Math.imul(ah2, bh8)) | 0; + lo = (lo + Math.imul(al1, bl9)) | 0; + mid = (mid + Math.imul(al1, bh9)) | 0; + mid = (mid + Math.imul(ah1, bl9)) | 0; + hi = (hi + Math.imul(ah1, bh9)) | 0; + var w10 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w10 >>> 26)) | 0; + w10 &= 0x3ffffff; + /* k = 11 */ + lo = Math.imul(al9, bl2); + mid = Math.imul(al9, bh2); + mid = (mid + Math.imul(ah9, bl2)) | 0; + hi = Math.imul(ah9, bh2); + lo = (lo + Math.imul(al8, bl3)) | 0; + mid = (mid + Math.imul(al8, bh3)) | 0; + mid = (mid + Math.imul(ah8, bl3)) | 0; + hi = (hi + Math.imul(ah8, bh3)) | 0; + lo = (lo + Math.imul(al7, bl4)) | 0; + mid = (mid + Math.imul(al7, bh4)) | 0; + mid = (mid + Math.imul(ah7, bl4)) | 0; + hi = (hi + Math.imul(ah7, bh4)) | 0; + lo = (lo + Math.imul(al6, bl5)) | 0; + mid = (mid + Math.imul(al6, bh5)) | 0; + mid = (mid + Math.imul(ah6, bl5)) | 0; + hi = (hi + Math.imul(ah6, bh5)) | 0; + lo = (lo + Math.imul(al5, bl6)) | 0; + mid = (mid + Math.imul(al5, bh6)) | 0; + mid = (mid + Math.imul(ah5, bl6)) | 0; + hi = (hi + Math.imul(ah5, bh6)) | 0; + lo = (lo + Math.imul(al4, bl7)) | 0; + mid = (mid + Math.imul(al4, bh7)) | 0; + mid = (mid + Math.imul(ah4, bl7)) | 0; + hi = (hi + Math.imul(ah4, bh7)) | 0; + lo = (lo + Math.imul(al3, bl8)) | 0; + mid = (mid + Math.imul(al3, bh8)) | 0; + mid = (mid + Math.imul(ah3, bl8)) | 0; + hi = (hi + Math.imul(ah3, bh8)) | 0; + lo = (lo + Math.imul(al2, bl9)) | 0; + mid = (mid + Math.imul(al2, bh9)) | 0; + mid = (mid + Math.imul(ah2, bl9)) | 0; + hi = (hi + Math.imul(ah2, bh9)) | 0; + var w11 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w11 >>> 26)) | 0; + w11 &= 0x3ffffff; + /* k = 12 */ + lo = Math.imul(al9, bl3); + mid = Math.imul(al9, bh3); + mid = (mid + Math.imul(ah9, bl3)) | 0; + hi = Math.imul(ah9, bh3); + lo = (lo + Math.imul(al8, bl4)) | 0; + mid = (mid + Math.imul(al8, bh4)) | 0; + mid = (mid + Math.imul(ah8, bl4)) | 0; + hi = (hi + Math.imul(ah8, bh4)) | 0; + lo = (lo + Math.imul(al7, bl5)) | 0; + mid = (mid + Math.imul(al7, bh5)) | 0; + mid = (mid + Math.imul(ah7, bl5)) | 0; + hi = (hi + Math.imul(ah7, bh5)) | 0; + lo = (lo + Math.imul(al6, bl6)) | 0; + mid = (mid + Math.imul(al6, bh6)) | 0; + mid = (mid + Math.imul(ah6, bl6)) | 0; + hi = (hi + Math.imul(ah6, bh6)) | 0; + lo = (lo + Math.imul(al5, bl7)) | 0; + mid = (mid + Math.imul(al5, bh7)) | 0; + mid = (mid + Math.imul(ah5, bl7)) | 0; + hi = (hi + Math.imul(ah5, bh7)) | 0; + lo = (lo + Math.imul(al4, bl8)) | 0; + mid = (mid + Math.imul(al4, bh8)) | 0; + mid = (mid + Math.imul(ah4, bl8)) | 0; + hi = (hi + Math.imul(ah4, bh8)) | 0; + lo = (lo + Math.imul(al3, bl9)) | 0; + mid = (mid + Math.imul(al3, bh9)) | 0; + mid = (mid + Math.imul(ah3, bl9)) | 0; + hi = (hi + Math.imul(ah3, bh9)) | 0; + var w12 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w12 >>> 26)) | 0; + w12 &= 0x3ffffff; + /* k = 13 */ + lo = Math.imul(al9, bl4); + mid = Math.imul(al9, bh4); + mid = (mid + Math.imul(ah9, bl4)) | 0; + hi = Math.imul(ah9, bh4); + lo = (lo + Math.imul(al8, bl5)) | 0; + mid = (mid + Math.imul(al8, bh5)) | 0; + mid = (mid + Math.imul(ah8, bl5)) | 0; + hi = (hi + Math.imul(ah8, bh5)) | 0; + lo = (lo + Math.imul(al7, bl6)) | 0; + mid = (mid + Math.imul(al7, bh6)) | 0; + mid = (mid + Math.imul(ah7, bl6)) | 0; + hi = (hi + Math.imul(ah7, bh6)) | 0; + lo = (lo + Math.imul(al6, bl7)) | 0; + mid = (mid + Math.imul(al6, bh7)) | 0; + mid = (mid + Math.imul(ah6, bl7)) | 0; + hi = (hi + Math.imul(ah6, bh7)) | 0; + lo = (lo + Math.imul(al5, bl8)) | 0; + mid = (mid + Math.imul(al5, bh8)) | 0; + mid = (mid + Math.imul(ah5, bl8)) | 0; + hi = (hi + Math.imul(ah5, bh8)) | 0; + lo = (lo + Math.imul(al4, bl9)) | 0; + mid = (mid + Math.imul(al4, bh9)) | 0; + mid = (mid + Math.imul(ah4, bl9)) | 0; + hi = (hi + Math.imul(ah4, bh9)) | 0; + var w13 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w13 >>> 26)) | 0; + w13 &= 0x3ffffff; + /* k = 14 */ + lo = Math.imul(al9, bl5); + mid = Math.imul(al9, bh5); + mid = (mid + Math.imul(ah9, bl5)) | 0; + hi = Math.imul(ah9, bh5); + lo = (lo + Math.imul(al8, bl6)) | 0; + mid = (mid + Math.imul(al8, bh6)) | 0; + mid = (mid + Math.imul(ah8, bl6)) | 0; + hi = (hi + Math.imul(ah8, bh6)) | 0; + lo = (lo + Math.imul(al7, bl7)) | 0; + mid = (mid + Math.imul(al7, bh7)) | 0; + mid = (mid + Math.imul(ah7, bl7)) | 0; + hi = (hi + Math.imul(ah7, bh7)) | 0; + lo = (lo + Math.imul(al6, bl8)) | 0; + mid = (mid + Math.imul(al6, bh8)) | 0; + mid = (mid + Math.imul(ah6, bl8)) | 0; + hi = (hi + Math.imul(ah6, bh8)) | 0; + lo = (lo + Math.imul(al5, bl9)) | 0; + mid = (mid + Math.imul(al5, bh9)) | 0; + mid = (mid + Math.imul(ah5, bl9)) | 0; + hi = (hi + Math.imul(ah5, bh9)) | 0; + var w14 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w14 >>> 26)) | 0; + w14 &= 0x3ffffff; + /* k = 15 */ + lo = Math.imul(al9, bl6); + mid = Math.imul(al9, bh6); + mid = (mid + Math.imul(ah9, bl6)) | 0; + hi = Math.imul(ah9, bh6); + lo = (lo + Math.imul(al8, bl7)) | 0; + mid = (mid + Math.imul(al8, bh7)) | 0; + mid = (mid + Math.imul(ah8, bl7)) | 0; + hi = (hi + Math.imul(ah8, bh7)) | 0; + lo = (lo + Math.imul(al7, bl8)) | 0; + mid = (mid + Math.imul(al7, bh8)) | 0; + mid = (mid + Math.imul(ah7, bl8)) | 0; + hi = (hi + Math.imul(ah7, bh8)) | 0; + lo = (lo + Math.imul(al6, bl9)) | 0; + mid = (mid + Math.imul(al6, bh9)) | 0; + mid = (mid + Math.imul(ah6, bl9)) | 0; + hi = (hi + Math.imul(ah6, bh9)) | 0; + var w15 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w15 >>> 26)) | 0; + w15 &= 0x3ffffff; + /* k = 16 */ + lo = Math.imul(al9, bl7); + mid = Math.imul(al9, bh7); + mid = (mid + Math.imul(ah9, bl7)) | 0; + hi = Math.imul(ah9, bh7); + lo = (lo + Math.imul(al8, bl8)) | 0; + mid = (mid + Math.imul(al8, bh8)) | 0; + mid = (mid + Math.imul(ah8, bl8)) | 0; + hi = (hi + Math.imul(ah8, bh8)) | 0; + lo = (lo + Math.imul(al7, bl9)) | 0; + mid = (mid + Math.imul(al7, bh9)) | 0; + mid = (mid + Math.imul(ah7, bl9)) | 0; + hi = (hi + Math.imul(ah7, bh9)) | 0; + var w16 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w16 >>> 26)) | 0; + w16 &= 0x3ffffff; + /* k = 17 */ + lo = Math.imul(al9, bl8); + mid = Math.imul(al9, bh8); + mid = (mid + Math.imul(ah9, bl8)) | 0; + hi = Math.imul(ah9, bh8); + lo = (lo + Math.imul(al8, bl9)) | 0; + mid = (mid + Math.imul(al8, bh9)) | 0; + mid = (mid + Math.imul(ah8, bl9)) | 0; + hi = (hi + Math.imul(ah8, bh9)) | 0; + var w17 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w17 >>> 26)) | 0; + w17 &= 0x3ffffff; + /* k = 18 */ + lo = Math.imul(al9, bl9); + mid = Math.imul(al9, bh9); + mid = (mid + Math.imul(ah9, bl9)) | 0; + hi = Math.imul(ah9, bh9); + var w18 = (((c + lo) | 0) + ((mid & 0x1fff) << 13)) | 0; + c = (((hi + (mid >>> 13)) | 0) + (w18 >>> 26)) | 0; + w18 &= 0x3ffffff; + o[0] = w0; + o[1] = w1; + o[2] = w2; + o[3] = w3; + o[4] = w4; + o[5] = w5; + o[6] = w6; + o[7] = w7; + o[8] = w8; + o[9] = w9; + o[10] = w10; + o[11] = w11; + o[12] = w12; + o[13] = w13; + o[14] = w14; + o[15] = w15; + o[16] = w16; + o[17] = w17; + o[18] = w18; + if (c !== 0) { + o[19] = c; + out.length++; } - } - invoker.fns = fns; - return invoker -} + return out; + }; -function updateListeners ( - on, - oldOn, - add, - remove$$1, - vm -) { - var name, def, cur, old, event; - for (name in on) { - def = cur = on[name]; - old = oldOn[name]; - event = normalizeEvent(name); - /* istanbul ignore if */ - if (isUndef(cur)) { - process.env.NODE_ENV !== 'production' && warn( - "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), - vm - ); - } else if (isUndef(old)) { - if (isUndef(cur.fns)) { - cur = on[name] = createFnInvoker(cur); + // Polyfill comb + if (!Math.imul) { + comb10MulTo = smallMulTo; + } + + function bigMulTo (self, num, out) { + out.negative = num.negative ^ self.negative; + out.length = self.length + num.length; + + var carry = 0; + var hncarry = 0; + for (var k = 0; k < out.length - 1; k++) { + // Sum all words with the same `i + j = k` and accumulate `ncarry`, + // note that ncarry could be >= 0x3ffffff + var ncarry = hncarry; + hncarry = 0; + var rword = carry & 0x3ffffff; + var maxJ = Math.min(k, num.length - 1); + for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { + var i = k - j; + var a = self.words[i] | 0; + var b = num.words[j] | 0; + var r = a * b; + + var lo = r & 0x3ffffff; + ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; + lo = (lo + rword) | 0; + rword = lo & 0x3ffffff; + ncarry = (ncarry + (lo >>> 26)) | 0; + + hncarry += ncarry >>> 26; + ncarry &= 0x3ffffff; } - add(event.name, cur, event.once, event.capture, event.passive, event.params); - } else if (cur !== old) { - old.fns = cur; - on[name] = old; + out.words[k] = rword; + carry = ncarry; + ncarry = hncarry; } - } - for (name in oldOn) { - if (isUndef(on[name])) { - event = normalizeEvent(name); - remove$$1(event.name, oldOn[name], event.capture); + if (carry !== 0) { + out.words[k] = carry; + } else { + out.length--; } - } -} - -/* */ -function mergeVNodeHook (def, hookKey, hook) { - if (def instanceof VNode) { - def = def.data.hook || (def.data.hook = {}); + return out.strip(); } - var invoker; - var oldHook = def[hookKey]; - function wrappedHook () { - hook.apply(this, arguments); - // important: remove merged hook to ensure it's called only once - // and prevent memory leak - remove(invoker.fns, wrappedHook); + function jumboMulTo (self, num, out) { + var fftm = new FFTM(); + return fftm.mulp(self, num, out); } - if (isUndef(oldHook)) { - // no existing hook - invoker = createFnInvoker([wrappedHook]); - } else { - /* istanbul ignore if */ - if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { - // already a merged invoker - invoker = oldHook; - invoker.fns.push(wrappedHook); + BN.prototype.mulTo = function mulTo (num, out) { + var res; + var len = this.length + num.length; + if (this.length === 10 && num.length === 10) { + res = comb10MulTo(this, num, out); + } else if (len < 63) { + res = smallMulTo(this, num, out); + } else if (len < 1024) { + res = bigMulTo(this, num, out); } else { - // existing plain hook - invoker = createFnInvoker([oldHook, wrappedHook]); + res = jumboMulTo(this, num, out); } - } - invoker.merged = true; - def[hookKey] = invoker; -} + return res; + }; -/* */ + // Cooley-Tukey algorithm for FFT + // slightly revisited to rely on looping instead of recursion -function extractPropsFromVNodeData ( - data, - Ctor, - tag -) { - // we are only extracting raw values here. - // validation and default values are handled in the child - // component itself. - var propOptions = Ctor.options.props; - if (isUndef(propOptions)) { - return - } - var res = {}; - var attrs = data.attrs; - var props = data.props; - if (isDef(attrs) || isDef(props)) { - for (var key in propOptions) { - var altKey = hyphenate(key); - if (process.env.NODE_ENV !== 'production') { - var keyInLowerCase = key.toLowerCase(); - if ( - key !== keyInLowerCase && - attrs && hasOwn(attrs, keyInLowerCase) - ) { - tip( - "Prop \"" + keyInLowerCase + "\" is passed to component " + - (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + - " \"" + key + "\". " + - "Note that HTML attributes are case-insensitive and camelCased " + - "props need to use their kebab-case equivalents when using in-DOM " + - "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." - ); - } - } - checkProp(res, props, key, altKey, true) || - checkProp(res, attrs, key, altKey, false); - } + function FFTM (x, y) { + this.x = x; + this.y = y; } - return res -} -function checkProp ( - res, - hash, - key, - altKey, - preserve -) { - if (isDef(hash)) { - if (hasOwn(hash, key)) { - res[key] = hash[key]; - if (!preserve) { - delete hash[key]; - } - return true - } else if (hasOwn(hash, altKey)) { - res[key] = hash[altKey]; - if (!preserve) { - delete hash[altKey]; - } - return true + FFTM.prototype.makeRBT = function makeRBT (N) { + var t = new Array(N); + var l = BN.prototype._countBits(N) - 1; + for (var i = 0; i < N; i++) { + t[i] = this.revBin(i, l, N); } - } - return false -} -/* */ + return t; + }; -// The template compiler attempts to minimize the need for normalization by -// statically analyzing the template at compile time. -// -// For plain HTML markup, normalization can be completely skipped because the -// generated render function is guaranteed to return Array. There are -// two cases where extra normalization is needed: + // Returns binary-reversed representation of `x` + FFTM.prototype.revBin = function revBin (x, l, N) { + if (x === 0 || x === N - 1) return x; -// 1. When the children contains components - because a functional component -// may return an Array instead of a single root. In this case, just a simple -// normalization is needed - if any child is an Array, we flatten the whole -// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep -// because functional components already normalize their own children. -function simpleNormalizeChildren (children) { - for (var i = 0; i < children.length; i++) { - if (Array.isArray(children[i])) { - return Array.prototype.concat.apply([], children) + var rb = 0; + for (var i = 0; i < l; i++) { + rb |= (x & 1) << (l - i - 1); + x >>= 1; } - } - return children -} - -// 2. When the children contains constructs that always generated nested Arrays, -// e.g.