(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i li.active').text(); $('.jxmegalayout-nav-vue #sectionsDropdown').text($.trim(btnDefaultText)); } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',{staticClass:"jxlist-group-item"},[_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();_vm.$emit('set-layout-type', _vm.name)}}},[_vm._v(_vm._s(_vm.item.lang))])])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-ebd8d94a", __vue__options__) } else { hotAPI.reload("data-v-ebd8d94a", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],3:[function(require,module,exports){ ;(function(){ // // // // // // var Export = require('./tabs/jxml-tools-export.vue') var Import = require('./tabs/jxml-tools-import.vue') var Options = require('./tabs/jxml-tools-options.vue') var ExtraContent = require('./tabs/jxml-tools-extra-content.vue') var ThemeBuilder = require('./tabs/jxml-tools-theme-builder.vue') module.exports = { props: ['tab', 'rawData'], methods: { adjustTabName: function(tabName) { return tabName.replace(' ', '_'); } }, components: { 'export': Export, 'import': Import, 'options': Options, 'extra_content': ExtraContent, 'theme_builder': ThemeBuilder } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"tab-pane",class:_vm.tab},[_c(_vm.adjustTabName(_vm.tab),{tag:"component",attrs:{"data":_vm.rawData}})],1)} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-676b0ea3", __vue__options__) } else { hotAPI.reload("data-v-676b0ea3", __vue__options__) } })()} },{"./tabs/jxml-tools-export.vue":7,"./tabs/jxml-tools-extra-content.vue":8,"./tabs/jxml-tools-import.vue":9,"./tabs/jxml-tools-options.vue":10,"./tabs/jxml-tools-theme-builder.vue":11,"vue":19,"vue-hot-reload-api":17}],4:[function(require,module,exports){ ;(function(){ // // // // module.exports = { props: ['tab', 'name'] } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('li',[_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();_vm.$emit('switch-active-tools-tab', _vm.tab)}}},[_vm._v(_vm._s(_vm.name))])])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-7dd5a164", __vue__options__) } else { hotAPI.reload("data-v-7dd5a164", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],5:[function(require,module,exports){ ;(function(){ // // // // // // // // // // // // // // // // // // // // // // // // var jxmlToolsTabsList = require('./jxml-tools-tabs-list.vue') var jxmlToolsTabsContent = require('./jxml-tools-tabs-content.vue') module.exports = { data: function() { return { tabs: jxmlToolsTabs, tabActive: jxmlToolsTabs[0]['type'], content: '' } }, methods: { loadToolsTab: function() { var options = { action: 'loadTool', tool_name: this.tabActive }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { if (rawData = response.body.rawData) { this.content = rawData; } else { this.content = response.body.content; } this.$store.commit('setReadyStatus'); }, function(error) { }) }, switchActiveTab: function(identifier) { this.$store.commit('setLoadingStatus'); this.tabActive = identifier; this.loadToolsTab(); } }, mounted: function() { this.tabActive = this.tabs[0]['type']; }, created: function() { this.loadToolsTab(); }, template: '#jxml-tools-tabs', components: { 'jxml-tools-tabs-list': jxmlToolsTabsList, 'jxml-tools-tabs-content': jxmlToolsTabsContent } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{"id":"tools-tabs"}},[_c('ul',{staticClass:"nav nav-pills col-sm-2 nav-stacked"},_vm._l((_vm.tabs),function(tab,key,index){return _c('jxml-tools-tabs-list',{key:key,class:{ active: _vm.tabActive == tab.type },attrs:{"tab":tab.type,"name":tab.name},on:{"switch-active-tools-tab":function($event){_vm.switchActiveTab(tab.type)}}})})),_vm._v(" "),_c('div',{staticClass:"tab-content col-sm-10"},_vm._l((_vm.tabs),function(tab,key,index){return (_vm.tabActive == tab.type)?_c('jxml-tools-tabs-content',{key:key,class:{ active: _vm.tabActive == tab.type },attrs:{"tab":tab.type,"rawData":_vm.content}}):_vm._e()}))])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-3afe7bf7", __vue__options__) } else { hotAPI.reload("data-v-3afe7bf7", __vue__options__) } })()} },{"./jxml-tools-tabs-content.vue":3,"./jxml-tools-tabs-list.vue":4,"vue":19,"vue-hot-reload-api":17}],6:[function(require,module,exports){ ;(function(){ // // // // // // // // // // // // // // // // // // // // // // // // module.exports = { props : ['data'], data: function() { return { new_name: null } } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"import-preview"},[(_vm.data.errors)?_c('div',[_vm._v(_vm._s(_vm.data.errors))]):(_vm.data.compatibility)?_c('div',[_vm._v(_vm._s(_vm.data.compatibility))]):_c('div',{staticClass:"layout-preview-box"},[_vm._v("\n "+_vm._s(_vm.trans('layout_name'))+"\n "),_c('span',{staticClass:"layout_name",class:{ layout_name_check: !_vm.data.check_name }},[_vm._v(_vm._s(_vm.data.layout_name))]),_c('br'),_vm._v(" "),(!_vm.data.check_name)?_c('div',[_vm._v(_vm._s(_vm.trans('add_new_preset_name'))+"\n "),_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.new_name),expression:"new_name"}],staticClass:"form-control",attrs:{"type":"text","value":"","id":"new_name_layout","name":"new_name_layout","autocomplete":"off"},domProps:{"value":(_vm.new_name)},on:{"input":function($event){if($event.target.composing){ return; }_vm.new_name=$event.target.value}}})]):_vm._e(),_vm._v("\n "+_vm._s(_vm.trans('hook'))+"\n "),_c('span',{staticClass:"hook_name"},[_vm._v(_vm._s(_vm.data.hook_name))]),_c('br'),_vm._v(" "),(_vm.data.pages)?_c('div',{staticClass:"jxmegalayout-admin container"},[_vm._v("\n "+_vm._s(_vm.trans('assigned_pages'))+"\n "+_vm._s(_vm.data.pages)+"\n ")]):_vm._e(),_vm._v("\n "+_vm._s(_vm.trans('preview'))+"\n "),_c('div',{staticClass:"jxmegalayout-admin container",domProps:{"innerHTML":_vm._s(_vm.data.layout_preview)}},[_vm._v("\n "+_vm._s(_vm.$layout_preview)+"\n ")])]),_vm._v(" "),(_vm.data.check_name || (_vm.new_name && _vm.new_name != _vm.data.layout_name))?_c('button',{staticClass:"btn btn-default center-block",attrs:{"id":"importLayoutArchiveApp"},on:{"click":function($event){$event.preventDefault();return _vm.$parent.getImportInfo($event)}}},[_vm._v(_vm._s(_vm.trans('import')))]):_vm._e()])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-1f9ee15c", __vue__options__) } else { hotAPI.reload("data-v-1f9ee15c", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],7:[function(require,module,exports){ ;(function(){ // // // // // // // // // // // // // // // // // // // // // // // // // module.exports = { props : ['data'], methods : { layoutPreview: function(id_layout) { this.$store.commit('setLoadingStatus'); var options = { action: 'layoutPreview', id_layout: id_layout }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { if (msg = response.body.msg) { this.$root.showPopup('
'+msg+'
'); } this.$store.commit('setReadyStatus'); }, function(error) { this.$store.commit('setErrorStatus'); }) }, layoutExport: function(id_layout) { this.$store.commit('setLoadingStatus'); var options = { action: 'layoutExport', id_layout: id_layout }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { if (href = response.body.href) { location.href = href; } this.$store.commit('setReadyStatus'); }, function(error) { this.$store.commit('setErrorStatus'); }) } } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._l((_vm.data),function(item,key){return _c('div',{key:key,staticClass:"block"},[_c('div',{staticClass:"hook-title",class:{ disabled: !item.layouts }},[_c('h4',[_vm._v(_vm._s(_vm.trans('hook'))+" \""+_vm._s(item.hook_name)+"\"")])]),_vm._v(" "),(item.layouts)?_c('ul',{staticClass:"tree"},_vm._l((item.layouts),function(layout,layoutKey){return _c('li',{key:layoutKey,staticClass:"item-name"},[_c('span',{staticClass:"tree-item-name"},[_c('i',{staticClass:"icon-image"}),_vm._v(" "),_c('label',{staticClass:"tree-toggler"},[_vm._v(_vm._s(layout.layout_name))]),_vm._v("\n (\n "),_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();_vm.layoutPreview(layout.id_layout)}}},[_vm._v(_vm._s(_vm.trans('layout_preview')))]),_vm._v("\n |\n "),_c('a',{attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();_vm.layoutExport(layout.id_layout)}}},[_vm._v(_vm._s(_vm.trans('layout_export')))]),_vm._v("\n )\n ")])])})):_c('p',{staticClass:"alert alert-info"},[_vm._v("\n "+_vm._s(_vm.trans('no_export'))+"\n ")])])}))} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-22f5d251", __vue__options__) } else { hotAPI.reload("data-v-22f5d251", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],8:[function(require,module,exports){ ;(function(){ // // // // // module.exports = { props: ['data'], data: function() { return { status: null, content: null } } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"jxpanel"},[_c('div',{domProps:{"innerHTML":_vm._s(_vm.data)}})])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-07352aaf", __vue__options__) } else { hotAPI.reload("data-v-07352aaf", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],9:[function(require,module,exports){ ;(function(){ // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // // var importPreview = require('./_partials/jxml-tools-import-preview.vue') module.exports = { props: ['data'], data: function() { return { preview: false, previewContent: '', errors: null } }, computed: { maxfilesize() { return this.$store.getters.maxfilesize; } }, mounted: function() { $('#selectLayoutArchiveApp').live('click', function(e) { $('#layoutArchiveApp').trigger('click'); }); $('#layoutArchiveNameApp').live('click', function(e) { $('#layoutArchiveApp').trigger('click'); }); $('#layoutArchiveNameApp').live('dragenter', function(e) { e.preventDefault(); }); $('#layoutArchiveNameApp').live('dragover', function(e) { e.preventDefault(); }); $('#layoutArchiveNameApp').live('drop', function(e) { e.preventDefault(); var files = e.originalEvent.dataTransfer.files; $('#layoutArchiveApp')[0].files[0] = files; $(this).val(files[0].name); }); }, methods : { getPreviewInfo: function(event) { this.$store.commit('setLoadingStatus'); var el = event.target; if (el.files !== undefined) { var files = el.files; var name = ''; $.each(files, function(index, value) { name += value.name + ', '; }); $('#layoutArchiveNameApp').val(name.slice(0, -2)); } else { var name = el.val().split(/[\\/]/); $('#layoutArchiveNameApp').val(name[name.length - 1]); } var file = $('#layoutArchiveApp')[0].files[0]; var formData = new FormData(); formData.append('file', file); this.sendFile(formData, file.name, file.size, 'preview'); }, getImportInfo: function() { this.$store.commit('setLoadingStatus'); var file = $('#layoutArchiveApp')[0].files[0]; var formData = new FormData(); formData.append('file', file); var nameLayout = $('input[name="new_name_layout"]').val(); if (typeof(nameLayout) != 'undefined' && nameLayout.length) { if (this.$root.validateLayoutName(nameLayout)) { this.sendFile(formData, file.name, file.size, 'import'); } else { $('.layout-preview-box').find('p.alert').remove(); $('.layout-preview-box').prepend('

' + jxml_layout_validate_error_text + '

'); this.$store.commit('setReadyStatus'); } } else { this.sendFile(formData, file.name, file.size, 'import'); } }, sendFile: function(formData, name, size, action) { var xhr = new XMLHttpRequest(); if (action == 'preview') { xhr.open('POST', this.$store.getters.endpoint + '&action=getImportInfo', false); } else { var nameLayout = $('input[name="new_name_layout"]').val(); if (typeof(nameLayout) != 'undefined' && nameLayout.length) { xhr.open('POST', this.$store.getters.endpoint + '&action=importLayout&name_layout=' + nameLayout, false); } else { xhr.open('POST', this.$store.getters.endpoint + '&action=importLayout', false); } } xhr.setRequestHeader("Cache-Control", "no-cache"); xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest"); xhr.setRequestHeader('X-FILE-NAME', name); xhr.setRequestHeader('X-FILE-SIZE', size); xhr.send(formData); if (xhr.status == 200) { if (action == 'preview') { this.preview = true; this.previewContent = JSON.parse(xhr.responseText)['rawData']; } else { if (JSON.parse(xhr.responseText).type != 'popup') { if (JSON.parse(xhr.responseText)['status']) { showSuccessMessage(JSON.parse(xhr.responseText)['response_msg']); $('#layoutArchiveNameApp').attr('value', ''); this.afterImport(); } this.optimizeMessage(); // refresh all preview to avoid caching during other archive processing this.preview = false; this.previewContent = ''; } else { $('.layout-preview-box').find('p.alert').remove(); $('.layout-preview-box').prepend('

' + JSON.parse(xhr.responseText).message + '

'); } } this.$store.commit('setReadyStatus'); } }, afterImport: function() { var options = { action: 'afterImport' }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options) }, optimizeMessage: function() { var options = { action: 'optimizeMessage' }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { if (response.body.needOptimization) { this.$root.jxmegalayoutNeedOptimization = true } }) } }, components: { 'jxml-tools-import-preview': importPreview } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('form',{staticClass:"defaultForm form-horizontal",attrs:{"id":"import_layout_form","method":"post","enctype":"multipart/form-data","novalidate":""}},[_c('div',{staticClass:"form-wrapper"},[_c('div',{staticClass:"form-group"},[_c('label',{staticClass:"control-label col-lg-3"},[_vm._v("\n "+_vm._s(_vm.trans('zip_file'))+"\n ")]),_vm._v(" "),_c('div',{staticClass:"col-lg-5"},[_c('div',{staticClass:"form-group"},[_c('div',{staticClass:"col-sm-12"},[_c('input',{staticClass:"hide",attrs:{"id":"layoutArchiveApp","type":"file","name":"themearchive"},on:{"change":function($event){$event.preventDefault();_vm.getPreviewInfo($event)}}}),_vm._v(" "),_c('div',{staticClass:"dummyfile input-group"},[_vm._m(0),_vm._v(" "),_c('input',{attrs:{"id":"layoutArchiveNameApp","type":"text","name":"filename","readonly":""},on:{"click":function($event){$event.preventDefault();return _vm.getImportInfo($event)}}}),_vm._v(" "),_c('span',{staticClass:"input-group-btn"},[_c('button',{staticClass:"btn btn-default",attrs:{"id":"selectLayoutArchiveApp","type":"button","name":"submitAddAttachments"}},[_vm._v(_vm._s(_vm.trans('add_file')))])])])])]),_vm._v(" "),_c('p',{staticClass:"help-block text-center"},[_vm._v("\n "+_vm._s(_vm.trans('browse_file'))),_c('br'),_vm._v("\n "+_vm._s(_vm.trans('max_file_size'))+" "+_vm._s(_vm.maxfilesize)),_c('br'),_vm._v("\n "+_vm._s(_vm.trans('server_settings_notification'))+"\n ")])])]),_vm._v(" "),(_vm.preview)?_c('div',{staticClass:"form-group layout-preview-wrapper",class:{ hidden: !_vm.preview }},[_c('jxml-tools-import-preview',{attrs:{"data":_vm.previewContent}})],1):_vm._e()])])} __vue__options__.staticRenderFns = [function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"input-group-addon"},[_c('i',{staticClass:"icon-file"})])}] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-d5aa5c7c", __vue__options__) } else { hotAPI.reload("data-v-d5aa5c7c", __vue__options__) } })()} },{"./_partials/jxml-tools-import-preview.vue":6,"vue":19,"vue-hot-reload-api":17}],10:[function(require,module,exports){ ;(function(){ // // // // // // // // // // // // // // // // // // // // // // // // // module.exports = { data: function() { return { showMessages: JXMEGALAYOUT_SHOW_MESSAGES } }, methods : { switchShowMessages: function() { this.$store.commit('setLoadingStatus'); var options = { action: 'showMessages' }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { this.showMessages = response.body.status; this.$store.commit('setReadyStatus'); showSuccessMessage(response.body.response_msg); }, function(error) { this.$store.commit('setErrorStatus'); }) }, resetToDefault: function() { this.$store.commit('setLoadingStatus'); var options = { action: 'resetToDefault' }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { if (response.body.status) { this.$store.commit('setReadyStatus'); showSuccessMessage(response.body.message); } else { showErrorMessage(response.body.message); } }, function(error) { this.$store.commit('setErrorStatus'); }) } } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"jxmegalayout-lsettins"},[_c('div',{staticClass:"form-wrapper"},[_c('div',{staticClass:"form-group"},[_c('label',{staticClass:"control-label pull-left"},[_vm._v(_vm._s(_vm.trans('optimization_label')))]),_vm._v(" "),_c('div',{staticClass:"jxlist-layout-btns",attrs:{"data-layout-id":"4"}},[_c('a',{staticClass:"layout-btn",attrs:{"id":"optionShowMessages","href":"#","data-layout-id":"4"}},[(_vm.showMessages)?_c('i',{staticClass:"process-icon-toggle-on",on:{"click":function($event){$event.preventDefault();return _vm.switchShowMessages($event)}}}):_vm._e(),_vm._v(" "),(!_vm.showMessages)?_c('i',{staticClass:"process-icon-toggle-off",on:{"click":function($event){$event.preventDefault();return _vm.switchShowMessages($event)}}}):_vm._e()])]),_vm._v(" "),_c('p',{staticClass:"desc"},[_c('small',[_vm._v(_vm._s(_vm.trans('optimization_notification')))])])]),_vm._v(" "),_c('div',{staticClass:"form-group"},[_c('label',{staticClass:"control-label pull-left"},[_vm._v(_vm._s(_vm.trans('reset_to_default')))]),_vm._v(" "),_c('a',{staticClass:"btn btn-default btn-sm reset-layouts",attrs:{"href":"#"},on:{"click":function($event){$event.preventDefault();return _vm.resetToDefault($event)}}},[_vm._v(_vm._s(_vm.trans('reset')))]),_vm._v(" "),_c('p',{staticClass:"desc"},[_c('small',[_vm._v(_vm._s(_vm.trans('remove_presets_notification')))])])])])])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-b223165e", __vue__options__) } else { hotAPI.reload("data-v-b223165e", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],11:[function(require,module,exports){ ;(function(){ // // // // // module.exports = { props: ['data'], data: function() { return { status: null, content: null } } } })() if (module.exports.__esModule) module.exports = module.exports.default var __vue__options__ = (typeof module.exports === "function"? module.exports.options: module.exports) if (__vue__options__.functional) {console.error("[vueify] functional components are not supported and should be defined in plain js files using render functions.")} __vue__options__.render = function render () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"jxpanel"},[_c('div',{domProps:{"innerHTML":_vm._s(_vm.data)}})])} __vue__options__.staticRenderFns = [] if (module.hot) {(function () { var hotAPI = require("vue-hot-reload-api") hotAPI.install(require("vue"), true) if (!hotAPI.compatible) return module.hot.accept() if (!module.hot.data) { hotAPI.createRecord("data-v-70fd990a", __vue__options__) } else { hotAPI.reload("data-v-70fd990a", __vue__options__) } })()} },{"vue":19,"vue-hot-reload-api":17}],12:[function(require,module,exports){ /** * 2017-2019 Zemez * * JX Mega Layout * * NOTICE OF LICENSE * * This source file is subject to the General Public License (GPL 2.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/GPL-2.0 * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade the module to newer * versions in the future. * * @author Zemez (Alexander Grosul & Alexander Pervakov) * @copyright 2017-2019 Zemez * @license http://opensource.org/licenses/GPL-2.0 General Public License (GPL 2.0) */ var Vue = require('vue') var VueResource = require('vue-resource') var Vuex = require('vuex') var jxmlSectionDropdown = require('./components/main/jxml-sections-dropdown.vue') var jxmlSectionTools = require('./components/tools/jxml-tools-tabs.vue') var jxmlSectionContent = require('./components/main/jxml-sections-content.vue') var Translation = require('./mixins/translate') Vue.use(VueResource) Vue.use(Vuex) const store = new Vuex.Store({ state: { max_file_size: max_file_size, endpoint: jxml_theme_url+'&ajax', status: 'loading', jxmegalayoutTabs: jxmegalayoutTabs, translations: app_translations }, getters: { maxfilesize(state) { return state.max_file_size }, status(state) { return state.status }, endpoint(state) { return state.endpoint }, getJxmegalayoutTabs(state) { return state.jxmegalayoutTabs } }, mutations: { setLoadingStatus(state) { state.status = 'loading'; }, setReadyStatus(state) { state.status = 'ready'; }, setErrorStatus(state) { state.status = 'error'; } } }); Vue.mixin(Translation) app = new Vue({ el: '#jxmegalayout-vue-app', store, data: { jxmegalayoutNeedOptimization: !needOptimization, jxmegalayoutAction: 'loadLayoutTab', jxmegalayoutTabsActive: 'displayHeader', jxmegalayoutToolsTabsActive: 'Export', jxmegalayoutTabsSectionType: 'MainLayouts' }, methods: { jxmegalayoutSetActiveTab: function(identificator) { this.jxmegalayoutTabsActive = identificator; //this.getTabContent(); }, onJxmegalayoutSetActiveSection: function(identificator) { this.jxmegalayoutTabsSectionType = identificator; if (this.jxmegalayoutTabsSectionType == 'MainLayouts') { this.jxmegalayoutTabsActive = 'displayHeader' } else { this.jxmegalayoutTabsActive = 'displayFooterProduct' } // invoke tab content updating after layouts type switching //this.getTabContent(); }, getTabContent: function() { if (this.jxmegalayoutTabsActive == 'Tools') { return; } this.$store.commit('setLoadingStatus'); var options = { action : this.jxmegalayoutAction, tab_name : this.jxmegalayoutTabsActive }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { this.$store.commit('setReadyStatus'); }, function(error) { }) }, showPopup: function(message) { $.fancybox.open({ type : 'inline', autoScale : true, minHeight : 30, minWidth : 320, maxWidth : 815, padding : 0, content : '
' + message + '
', helpers : { overlay : { locked : false } }, afterClose : function() { $('.button-container a:not(.edit-styles)').removeClass('active'); } }); }, validateLayoutName : function(name) { if ($.trim(name) == '') { return false; } for (i = 0; i < name.length; i++) { if (i == 0 && name[i] == '-') { return false; } if (/^[a-zA-Z0-9-]*$/.test(name[i]) == false) { return false; } } return true; }, optimizeFiles: function() { var options = { action : 'updateOptionOptimize' }; var resource = this.$resource(this.$store.getters.endpoint); resource.get(options).then(function(response) { this.$store.commit('setReadyStatus'); this.jxmegalayoutNeedOptimization = false; showSuccessMessage(response.body.response_msg); }, function(error) {}) } }, created: function() { this.$store.commit('setReadyStatus'); //this.getTabContent(); }, computed: { status() { return this.$store.getters.status; }, jxmegalayoutTabs() { return this.$store.getters.getJxmegalayoutTabs; } }, components: { 'jxml-sections-dropdown': jxmlSectionDropdown, 'jxml-tools-tabs': jxmlSectionTools, 'jxml-section-content': jxmlSectionContent } }); },{"./components/main/jxml-sections-content.vue":1,"./components/main/jxml-sections-dropdown.vue":2,"./components/tools/jxml-tools-tabs.vue":5,"./mixins/translate":13,"vue":19,"vue-resource":18,"vuex":21}],13:[function(require,module,exports){ /** * 2017-2019 Zemez * * JX Mega Layout * * NOTICE OF LICENSE * * This source file is subject to the General Public License (GPL 2.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/GPL-2.0 * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade the module to newer * versions in the future. * * @author Zemez (Alexander Grosul & Alexander Pervakov) * @copyright 2017-2019 Zemez * @license http://opensource.org/licenses/GPL-2.0 General Public License (GPL 2.0) */ module.exports = { methods: { trans(key) { return this.$store.state.translations[key]; } } }; },{}],14:[function(require,module,exports){ },{}],15:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; // 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. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (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 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); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } 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; } currentQueue = null; draining = false; runClearTimeout(timeout); } 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); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } 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 = {}; function noop() {} 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; process.listeners = function (name) { 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; }; },{}],16:[function(require,module,exports){ (function (setImmediate,clearImmediate){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; var slice = Array.prototype.slice; var immediateIds = {}; var nextImmediateId = 0; // DOM APIs, for completeness exports.setTimeout = function() { return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); }; exports.setInterval = function() { return new Timeout(apply.call(setInterval, window, arguments), clearInterval); }; exports.clearTimeout = exports.clearInterval = function(timeout) { timeout.close(); }; function Timeout(id, clearFn) { this._id = id; this._clearFn = clearFn; } Timeout.prototype.unref = Timeout.prototype.ref = function() {}; Timeout.prototype.close = function() { this._clearFn.call(window, this._id); }; // Does not start the time, just sets up the members needed. exports.enroll = function(item, msecs) { clearTimeout(item._idleTimeoutId); item._idleTimeout = msecs; }; exports.unenroll = function(item) { clearTimeout(item._idleTimeoutId); item._idleTimeout = -1; }; exports._unrefActive = exports.active = function(item) { clearTimeout(item._idleTimeoutId); var msecs = item._idleTimeout; if (msecs >= 0) { item._idleTimeoutId = setTimeout(function onTimeout() { if (item._onTimeout) item._onTimeout(); }, msecs); } }; // That's not how node.js implements it but the exposed api is the same. exports.setImmediate = typeof setImmediate === "function" ? setImmediate : function(fn) { var id = nextImmediateId++; var args = arguments.length < 2 ? false : slice.call(arguments, 1); immediateIds[id] = true; nextTick(function onNextTick() { if (immediateIds[id]) { // fn.call() is faster so we optimize for the common use-case // @see http://jsperf.com/call-apply-segu if (args) { fn.apply(null, args); } else { fn.call(null); } // Prevent ids from leaking exports.clearImmediate(id); } }); return id; }; exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { delete immediateIds[id]; }; }).call(this,require("timers").setImmediate,require("timers").clearImmediate) },{"process/browser.js":15,"timers":16}],17:[function(require,module,exports){ var Vue // late bind var version var map = (window.__VUE_HOT_MAP__ = Object.create(null)) var installed = false var isBrowserify = false var initHookName = 'beforeCreate' exports.install = function (vue, browserify) { if (installed) { return } installed = true Vue = vue.__esModule ? vue.default : vue version = Vue.version.split('.').map(Number) isBrowserify = browserify // compat with < 2.0.0-alpha.7 if (Vue.config._lifecycleHooks.indexOf('init') > -1) { initHookName = 'init' } exports.compatible = version[0] >= 2 if (!exports.compatible) { console.warn( '[HMR] You are using a version of vue-hot-reload-api that is ' + 'only compatible with Vue.js core ^2.0.0.' ) return } } /** * Create a record for a hot module, which keeps track of its constructor * and instances * * @param {String} id * @param {Object} options */ exports.createRecord = function (id, options) { if(map[id]) { return } var Ctor = null if (typeof options === 'function') { Ctor = options options = Ctor.options } makeOptionsHot(id, options) map[id] = { Ctor: Ctor, options: options, instances: [] } } /** * Check if module is recorded * * @param {String} id */ exports.isRecorded = function (id) { return typeof map[id] !== 'undefined' } /** * Make a Component options object hot. * * @param {String} id * @param {Object} options */ function makeOptionsHot(id, options) { if (options.functional) { var render = options.render options.render = function (h, ctx) { var instances = map[id].instances if (ctx && instances.indexOf(ctx.parent) < 0) { instances.push(ctx.parent) } return render(h, ctx) } } else { injectHook(options, initHookName, function() { var record = map[id] if (!record.Ctor) { record.Ctor = this.constructor } record.instances.push(this) }) injectHook(options, 'beforeDestroy', function() { var instances = map[id].instances instances.splice(instances.indexOf(this), 1) }) } } /** * Inject a hook to a hot reloadable component so that * we can keep track of it. * * @param {Object} options * @param {String} name * @param {Function} hook */ function injectHook(options, name, hook) { var existing = options[name] options[name] = existing ? Array.isArray(existing) ? existing.concat(hook) : [existing, hook] : [hook] } function tryWrap(fn) { return function (id, arg) { try { fn(id, arg) } catch (e) { console.error(e) console.warn( 'Something went wrong during Vue component hot-reload. Full reload required.' ) } } } function updateOptions (oldOptions, newOptions) { for (var key in oldOptions) { if (!(key in newOptions)) { delete oldOptions[key] } } for (var key$1 in newOptions) { oldOptions[key$1] = newOptions[key$1] } } exports.rerender = tryWrap(function (id, options) { var record = map[id] if (!options) { record.instances.slice().forEach(function (instance) { instance.$forceUpdate() }) return } if (typeof options === 'function') { options = options.options } if (record.Ctor) { record.Ctor.options.render = options.render record.Ctor.options.staticRenderFns = options.staticRenderFns record.instances.slice().forEach(function (instance) { instance.$options.render = options.render instance.$options.staticRenderFns = options.staticRenderFns // reset static trees // pre 2.5, all static trees are cahced together on the instance if (instance._staticTrees) { instance._staticTrees = [] } // 2.5.0 if (Array.isArray(record.Ctor.options.cached)) { record.Ctor.options.cached = [] } // 2.5.3 if (Array.isArray(instance.$options.cached)) { instance.$options.cached = [] } // post 2.5.4: v-once trees are cached on instance._staticTrees. // Pure static trees are cached on the staticRenderFns array // (both already reset above) instance.$forceUpdate() }) } else { // functional or no instance created yet record.options.render = options.render record.options.staticRenderFns = options.staticRenderFns // handle functional component re-render if (record.options.functional) { // rerender with full options if (Object.keys(options).length > 2) { updateOptions(record.options, options) } else { // template-only rerender. // need to inject the style injection code for CSS modules // to work properly. var injectStyles = record.options._injectStyles if (injectStyles) { var render = options.render record.options.render = function (h, ctx) { injectStyles.call(ctx) return render(h, ctx) } } } record.options._Ctor = null // 2.5.3 if (Array.isArray(record.options.cached)) { record.options.cached = [] } record.instances.slice().forEach(function (instance) { instance.$forceUpdate() }) } } }) exports.reload = tryWrap(function (id, options) { var record = map[id] if (options) { if (typeof options === 'function') { options = options.options } makeOptionsHot(id, options) if (record.Ctor) { if (version[1] < 2) { // preserve pre 2.2 behavior for global mixin handling record.Ctor.extendOptions = options } var newCtor = record.Ctor.super.extend(options) record.Ctor.options = newCtor.options record.Ctor.cid = newCtor.cid record.Ctor.prototype = newCtor.prototype if (newCtor.release) { // temporary global mixin strategy used in < 2.0.0-alpha.6 newCtor.release() } } else { updateOptions(record.options, options) } } record.instances.slice().forEach(function (instance) { if (instance.$vnode && instance.$vnode.context) { instance.$vnode.context.$forceUpdate() } else { console.warn( 'Root or manually mounted instance modified. Full reload required.' ) } }) }) },{}],18:[function(require,module,exports){ /*! * vue-resource v1.5.1 * https://github.com/pagekit/vue-resource * Released under the MIT License. */ 'use strict'; /** * Promises/A+ polyfill v1.1.4 (https://github.com/bramstein/promis) */ var RESOLVED = 0; var REJECTED = 1; var PENDING = 2; function Promise$1(executor) { this.state = PENDING; this.value = undefined; this.deferred = []; var promise = this; try { executor(function (x) { promise.resolve(x); }, function (r) { promise.reject(r); }); } catch (e) { promise.reject(e); } } Promise$1.reject = function (r) { return new Promise$1(function (resolve, reject) { reject(r); }); }; Promise$1.resolve = function (x) { return new Promise$1(function (resolve, reject) { resolve(x); }); }; Promise$1.all = function all(iterable) { return new Promise$1(function (resolve, reject) { var count = 0, result = []; if (iterable.length === 0) { resolve(result); } function resolver(i) { return function (x) { result[i] = x; count += 1; if (count === iterable.length) { resolve(result); } }; } for (var i = 0; i < iterable.length; i += 1) { Promise$1.resolve(iterable[i]).then(resolver(i), reject); } }); }; Promise$1.race = function race(iterable) { return new Promise$1(function (resolve, reject) { for (var i = 0; i < iterable.length; i += 1) { Promise$1.resolve(iterable[i]).then(resolve, reject); } }); }; var p = Promise$1.prototype; p.resolve = function resolve(x) { var promise = this; if (promise.state === PENDING) { if (x === promise) { throw new TypeError('Promise settled with itself.'); } var called = false; try { var then = x && x['then']; if (x !== null && typeof x === 'object' && typeof then === 'function') { then.call(x, function (x) { if (!called) { promise.resolve(x); } called = true; }, function (r) { if (!called) { promise.reject(r); } called = true; }); return; } } catch (e) { if (!called) { promise.reject(e); } return; } promise.state = RESOLVED; promise.value = x; promise.notify(); } }; p.reject = function reject(reason) { var promise = this; if (promise.state === PENDING) { if (reason === promise) { throw new TypeError('Promise settled with itself.'); } promise.state = REJECTED; promise.value = reason; promise.notify(); } }; p.notify = function notify() { var promise = this; nextTick(function () { if (promise.state !== PENDING) { while (promise.deferred.length) { var deferred = promise.deferred.shift(), onResolved = deferred[0], onRejected = deferred[1], resolve = deferred[2], reject = deferred[3]; try { if (promise.state === RESOLVED) { if (typeof onResolved === 'function') { resolve(onResolved.call(undefined, promise.value)); } else { resolve(promise.value); } } else if (promise.state === REJECTED) { if (typeof onRejected === 'function') { resolve(onRejected.call(undefined, promise.value)); } else { reject(promise.value); } } } catch (e) { reject(e); } } } }); }; p.then = function then(onResolved, onRejected) { var promise = this; return new Promise$1(function (resolve, reject) { promise.deferred.push([onResolved, onRejected, resolve, reject]); promise.notify(); }); }; p.catch = function (onRejected) { return this.then(undefined, onRejected); }; /** * Promise adapter. */ if (typeof Promise === 'undefined') { window.Promise = Promise$1; } function PromiseObj(executor, context) { if (executor instanceof Promise) { this.promise = executor; } else { this.promise = new Promise(executor.bind(context)); } this.context = context; } PromiseObj.all = function (iterable, context) { return new PromiseObj(Promise.all(iterable), context); }; PromiseObj.resolve = function (value, context) { return new PromiseObj(Promise.resolve(value), context); }; PromiseObj.reject = function (reason, context) { return new PromiseObj(Promise.reject(reason), context); }; PromiseObj.race = function (iterable, context) { return new PromiseObj(Promise.race(iterable), context); }; var p$1 = PromiseObj.prototype; p$1.bind = function (context) { this.context = context; return this; }; p$1.then = function (fulfilled, rejected) { if (fulfilled && fulfilled.bind && this.context) { fulfilled = fulfilled.bind(this.context); } if (rejected && rejected.bind && this.context) { rejected = rejected.bind(this.context); } return new PromiseObj(this.promise.then(fulfilled, rejected), this.context); }; p$1.catch = function (rejected) { if (rejected && rejected.bind && this.context) { rejected = rejected.bind(this.context); } return new PromiseObj(this.promise.catch(rejected), this.context); }; p$1.finally = function (callback) { return this.then(function (value) { callback.call(this); return value; }, function (reason) { callback.call(this); return Promise.reject(reason); } ); }; /** * Utility functions. */ var ref = {}; var hasOwnProperty = ref.hasOwnProperty; var ref$1 = []; var slice = ref$1.slice; var debug = false, ntick; var inBrowser = typeof window !== 'undefined'; function Util (ref) { var config = ref.config; var nextTick = ref.nextTick; ntick = nextTick; debug = config.debug || !config.silent; } function warn(msg) { if (typeof console !== 'undefined' && debug) { console.warn('[VueResource warn]: ' + msg); } } function error(msg) { if (typeof console !== 'undefined') { console.error(msg); } } function nextTick(cb, ctx) { return ntick(cb, ctx); } function trim(str) { return str ? str.replace(/^\s*|\s*$/g, '') : ''; } function trimEnd(str, chars) { if (str && chars === undefined) { return str.replace(/\s+$/, ''); } if (!str || !chars) { return str; } return str.replace(new RegExp(("[" + chars + "]+$")), ''); } function toLower(str) { return str ? str.toLowerCase() : ''; } function toUpper(str) { return str ? str.toUpperCase() : ''; } var isArray = Array.isArray; function isString(val) { return typeof val === 'string'; } function isFunction(val) { return typeof val === 'function'; } function isObject(obj) { return obj !== null && typeof obj === 'object'; } function isPlainObject(obj) { return isObject(obj) && Object.getPrototypeOf(obj) == Object.prototype; } function isBlob(obj) { return typeof Blob !== 'undefined' && obj instanceof Blob; } function isFormData(obj) { return typeof FormData !== 'undefined' && obj instanceof FormData; } function when(value, fulfilled, rejected) { var promise = PromiseObj.resolve(value); if (arguments.length < 2) { return promise; } return promise.then(fulfilled, rejected); } function options(fn, obj, opts) { opts = opts || {}; if (isFunction(opts)) { opts = opts.call(obj); } return merge(fn.bind({$vm: obj, $options: opts}), fn, {$options: opts}); } function each(obj, iterator) { var i, key; if (isArray(obj)) { for (i = 0; i < obj.length; i++) { iterator.call(obj[i], obj[i], i); } } else if (isObject(obj)) { for (key in obj) { if (hasOwnProperty.call(obj, key)) { iterator.call(obj[key], obj[key], key); } } } return obj; } var assign = Object.assign || _assign; function merge(target) { var args = slice.call(arguments, 1); args.forEach(function (source) { _merge(target, source, true); }); return target; } function defaults(target) { var args = slice.call(arguments, 1); args.forEach(function (source) { for (var key in source) { if (target[key] === undefined) { target[key] = source[key]; } } }); return target; } function _assign(target) { var args = slice.call(arguments, 1); args.forEach(function (source) { _merge(target, source); }); return target; } function _merge(target, source, deep) { for (var key in source) { if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { if (isPlainObject(source[key]) && !isPlainObject(target[key])) { target[key] = {}; } if (isArray(source[key]) && !isArray(target[key])) { target[key] = []; } _merge(target[key], source[key], deep); } else if (source[key] !== undefined) { target[key] = source[key]; } } } /** * Root Prefix Transform. */ function root (options$$1, next) { var url = next(options$$1); if (isString(options$$1.root) && !/^(https?:)?\//.test(url)) { url = trimEnd(options$$1.root, '/') + '/' + url; } return url; } /** * Query Parameter Transform. */ function query (options$$1, next) { var urlParams = Object.keys(Url.options.params), query = {}, url = next(options$$1); each(options$$1.params, function (value, key) { if (urlParams.indexOf(key) === -1) { query[key] = value; } }); query = Url.params(query); if (query) { url += (url.indexOf('?') == -1 ? '?' : '&') + query; } return url; } /** * URL Template v2.0.6 (https://github.com/bramstein/url-template) */ function expand(url, params, variables) { var tmpl = parse(url), expanded = tmpl.expand(params); if (variables) { variables.push.apply(variables, tmpl.vars); } return expanded; } function parse(template) { var operators = ['+', '#', '.', '/', ';', '?', '&'], variables = []; return { vars: variables, expand: function expand(context) { return template.replace(/\{([^{}]+)\}|([^{}]+)/g, function (_, expression, literal) { if (expression) { var operator = null, values = []; if (operators.indexOf(expression.charAt(0)) !== -1) { operator = expression.charAt(0); expression = expression.substr(1); } expression.split(/,/g).forEach(function (variable) { var tmp = /([^:*]*)(?::(\d+)|(\*))?/.exec(variable); values.push.apply(values, getValues(context, operator, tmp[1], tmp[2] || tmp[3])); variables.push(tmp[1]); }); if (operator && operator !== '+') { var separator = ','; if (operator === '?') { separator = '&'; } else if (operator !== '#') { separator = operator; } return (values.length !== 0 ? operator : '') + values.join(separator); } else { return values.join(','); } } else { return encodeReserved(literal); } }); } }; } function getValues(context, operator, key, modifier) { var value = context[key], result = []; if (isDefined(value) && value !== '') { if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { value = value.toString(); if (modifier && modifier !== '*') { value = value.substring(0, parseInt(modifier, 10)); } result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null)); } else { if (modifier === '*') { if (Array.isArray(value)) { value.filter(isDefined).forEach(function (value) { result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : null)); }); } else { Object.keys(value).forEach(function (k) { if (isDefined(value[k])) { result.push(encodeValue(operator, value[k], k)); } }); } } else { var tmp = []; if (Array.isArray(value)) { value.filter(isDefined).forEach(function (value) { tmp.push(encodeValue(operator, value)); }); } else { Object.keys(value).forEach(function (k) { if (isDefined(value[k])) { tmp.push(encodeURIComponent(k)); tmp.push(encodeValue(operator, value[k].toString())); } }); } if (isKeyOperator(operator)) { result.push(encodeURIComponent(key) + '=' + tmp.join(',')); } else if (tmp.length !== 0) { result.push(tmp.join(',')); } } } } else { if (operator === ';') { result.push(encodeURIComponent(key)); } else if (value === '' && (operator === '&' || operator === '?')) { result.push(encodeURIComponent(key) + '='); } else if (value === '') { result.push(''); } } return result; } function isDefined(value) { return value !== undefined && value !== null; } function isKeyOperator(operator) { return operator === ';' || operator === '&' || operator === '?'; } function encodeValue(operator, value, key) { value = (operator === '+' || operator === '#') ? encodeReserved(value) : encodeURIComponent(value); if (key) { return encodeURIComponent(key) + '=' + value; } else { return value; } } function encodeReserved(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) { if (!/%[0-9A-Fa-f]/.test(part)) { part = encodeURI(part); } return part; }).join(''); } /** * URL Template (RFC 6570) Transform. */ function template (options) { var variables = [], url = expand(options.url, options.params, variables); variables.forEach(function (key) { delete options.params[key]; }); return url; } /** * Service for URL templating. */ function Url(url, params) { var self = this || {}, options$$1 = url, transform; if (isString(url)) { options$$1 = {url: url, params: params}; } options$$1 = merge({}, Url.options, self.$options, options$$1); Url.transforms.forEach(function (handler) { if (isString(handler)) { handler = Url.transform[handler]; } if (isFunction(handler)) { transform = factory(handler, transform, self.$vm); } }); return transform(options$$1); } /** * Url options. */ Url.options = { url: '', root: null, params: {} }; /** * Url transforms. */ Url.transform = {template: template, query: query, root: root}; Url.transforms = ['template', 'query', 'root']; /** * Encodes a Url parameter string. * * @param {Object} obj */ Url.params = function (obj) { var params = [], escape = encodeURIComponent; params.add = function (key, value) { if (isFunction(value)) { value = value(); } if (value === null) { value = ''; } this.push(escape(key) + '=' + escape(value)); }; serialize(params, obj); return params.join('&').replace(/%20/g, '+'); }; /** * Parse a URL and return its components. * * @param {String} url */ Url.parse = function (url) { var el = document.createElement('a'); if (document.documentMode) { el.href = url; url = el.href; } el.href = url; return { href: el.href, protocol: el.protocol ? el.protocol.replace(/:$/, '') : '', port: el.port, host: el.host, hostname: el.hostname, pathname: el.pathname.charAt(0) === '/' ? el.pathname : '/' + el.pathname, search: el.search ? el.search.replace(/^\?/, '') : '', hash: el.hash ? el.hash.replace(/^#/, '') : '' }; }; function factory(handler, next, vm) { return function (options$$1) { return handler.call(vm, options$$1, next); }; } function serialize(params, obj, scope) { var array = isArray(obj), plain = isPlainObject(obj), hash; each(obj, function (value, key) { hash = isObject(value) || isArray(value); if (scope) { key = scope + '[' + (plain || hash ? key : '') + ']'; } if (!scope && array) { params.add(value.name, value.value); } else if (hash) { serialize(params, value, key); } else { params.add(key, value); } }); } /** * XDomain client (Internet Explorer). */ function xdrClient (request) { return new PromiseObj(function (resolve) { var xdr = new XDomainRequest(), handler = function (ref) { var type = ref.type; var status = 0; if (type === 'load') { status = 200; } else if (type === 'error') { status = 500; } resolve(request.respondWith(xdr.responseText, {status: status})); }; request.abort = function () { return xdr.abort(); }; xdr.open(request.method, request.getUrl()); if (request.timeout) { xdr.timeout = request.timeout; } xdr.onload = handler; xdr.onabort = handler; xdr.onerror = handler; xdr.ontimeout = handler; xdr.onprogress = function () {}; xdr.send(request.getBody()); }); } /** * CORS Interceptor. */ var SUPPORTS_CORS = inBrowser && 'withCredentials' in new XMLHttpRequest(); function cors (request) { if (inBrowser) { var orgUrl = Url.parse(location.href); var reqUrl = Url.parse(request.getUrl()); if (reqUrl.protocol !== orgUrl.protocol || reqUrl.host !== orgUrl.host) { request.crossOrigin = true; request.emulateHTTP = false; if (!SUPPORTS_CORS) { request.client = xdrClient; } } } } /** * Form data Interceptor. */ function form (request) { if (isFormData(request.body)) { request.headers.delete('Content-Type'); } else if (isObject(request.body) && request.emulateJSON) { request.body = Url.params(request.body); request.headers.set('Content-Type', 'application/x-www-form-urlencoded'); } } /** * JSON Interceptor. */ function json (request) { var type = request.headers.get('Content-Type') || ''; if (isObject(request.body) && type.indexOf('application/json') === 0) { request.body = JSON.stringify(request.body); } return function (response) { return response.bodyText ? when(response.text(), function (text) { var type = response.headers.get('Content-Type') || ''; if (type.indexOf('application/json') === 0 || isJson(text)) { try { response.body = JSON.parse(text); } catch (e) { response.body = null; } } else { response.body = text; } return response; }) : response; }; } function isJson(str) { var start = str.match(/^\s*(\[|\{)/); var end = {'[': /]\s*$/, '{': /}\s*$/}; return start && end[start[1]].test(str); } /** * JSONP client (Browser). */ function jsonpClient (request) { return new PromiseObj(function (resolve) { var name = request.jsonp || 'callback', callback = request.jsonpCallback || '_jsonp' + Math.random().toString(36).substr(2), body = null, handler, script; handler = function (ref) { var type = ref.type; var status = 0; if (type === 'load' && body !== null) { status = 200; } else if (type === 'error') { status = 500; } if (status && window[callback]) { delete window[callback]; document.body.removeChild(script); } resolve(request.respondWith(body, {status: status})); }; window[callback] = function (result) { body = JSON.stringify(result); }; request.abort = function () { handler({type: 'abort'}); }; request.params[name] = callback; if (request.timeout) { setTimeout(request.abort, request.timeout); } script = document.createElement('script'); script.src = request.getUrl(); script.type = 'text/javascript'; script.async = true; script.onload = handler; script.onerror = handler; document.body.appendChild(script); }); } /** * JSONP Interceptor. */ function jsonp (request) { if (request.method == 'JSONP') { request.client = jsonpClient; } } /** * Before Interceptor. */ function before (request) { if (isFunction(request.before)) { request.before.call(this, request); } } /** * HTTP method override Interceptor. */ function method (request) { if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) { request.headers.set('X-HTTP-Method-Override', request.method); request.method = 'POST'; } } /** * Header Interceptor. */ function header (request) { var headers = assign({}, Http.headers.common, !request.crossOrigin ? Http.headers.custom : {}, Http.headers[toLower(request.method)] ); each(headers, function (value, name) { if (!request.headers.has(name)) { request.headers.set(name, value); } }); } /** * XMLHttp client (Browser). */ function xhrClient (request) { return new PromiseObj(function (resolve) { var xhr = new XMLHttpRequest(), handler = function (event) { var response = request.respondWith( 'response' in xhr ? xhr.response : xhr.responseText, { status: xhr.status === 1223 ? 204 : xhr.status, // IE9 status bug statusText: xhr.status === 1223 ? 'No Content' : trim(xhr.statusText) }); each(trim(xhr.getAllResponseHeaders()).split('\n'), function (row) { response.headers.append(row.slice(0, row.indexOf(':')), row.slice(row.indexOf(':') + 1)); }); resolve(response); }; request.abort = function () { return xhr.abort(); }; xhr.open(request.method, request.getUrl(), true); if (request.timeout) { xhr.timeout = request.timeout; } if (request.responseType && 'responseType' in xhr) { xhr.responseType = request.responseType; } if (request.withCredentials || request.credentials) { xhr.withCredentials = true; } if (!request.crossOrigin) { request.headers.set('X-Requested-With', 'XMLHttpRequest'); } // deprecated use downloadProgress if (isFunction(request.progress) && request.method === 'GET') { xhr.addEventListener('progress', request.progress); } if (isFunction(request.downloadProgress)) { xhr.addEventListener('progress', request.downloadProgress); } // deprecated use uploadProgress if (isFunction(request.progress) && /^(POST|PUT)$/i.test(request.method)) { xhr.upload.addEventListener('progress', request.progress); } if (isFunction(request.uploadProgress) && xhr.upload) { xhr.upload.addEventListener('progress', request.uploadProgress); } request.headers.forEach(function (value, name) { xhr.setRequestHeader(name, value); }); xhr.onload = handler; xhr.onabort = handler; xhr.onerror = handler; xhr.ontimeout = handler; xhr.send(request.getBody()); }); } /** * Http client (Node). */ function nodeClient (request) { var client = require('got'); return new PromiseObj(function (resolve) { var url = request.getUrl(); var body = request.getBody(); var method = request.method; var headers = {}, handler; request.headers.forEach(function (value, name) { headers[name] = value; }); client(url, {body: body, method: method, headers: headers}).then(handler = function (resp) { var response = request.respondWith(resp.body, { status: resp.statusCode, statusText: trim(resp.statusMessage) }); each(resp.headers, function (value, name) { response.headers.set(name, value); }); resolve(response); }, function (error$$1) { return handler(error$$1.response); }); }); } /** * Base client. */ function Client (context) { var reqHandlers = [sendRequest], resHandlers = []; if (!isObject(context)) { context = null; } function Client(request) { while (reqHandlers.length) { var handler = reqHandlers.pop(); if (isFunction(handler)) { var response = (void 0), next = (void 0); response = handler.call(context, request, function (val) { return next = val; }) || next; if (isObject(response)) { return new PromiseObj(function (resolve, reject) { resHandlers.forEach(function (handler) { response = when(response, function (response) { return handler.call(context, response) || response; }, reject); }); when(response, resolve, reject); }, context); } if (isFunction(response)) { resHandlers.unshift(response); } } else { warn(("Invalid interceptor of type " + (typeof handler) + ", must be a function")); } } } Client.use = function (handler) { reqHandlers.push(handler); }; return Client; } function sendRequest(request) { var client = request.client || (inBrowser ? xhrClient : nodeClient); return client(request); } /** * HTTP Headers. */ var Headers = function Headers(headers) { var this$1 = this; this.map = {}; each(headers, function (value, name) { return this$1.append(name, value); }); }; Headers.prototype.has = function has (name) { return getName(this.map, name) !== null; }; Headers.prototype.get = function get (name) { var list = this.map[getName(this.map, name)]; return list ? list.join() : null; }; Headers.prototype.getAll = function getAll (name) { return this.map[getName(this.map, name)] || []; }; Headers.prototype.set = function set (name, value) { this.map[normalizeName(getName(this.map, name) || name)] = [trim(value)]; }; Headers.prototype.append = function append (name, value) { var list = this.map[getName(this.map, name)]; if (list) { list.push(trim(value)); } else { this.set(name, value); } }; Headers.prototype.delete = function delete$1 (name) { delete this.map[getName(this.map, name)]; }; Headers.prototype.deleteAll = function deleteAll () { this.map = {}; }; Headers.prototype.forEach = function forEach (callback, thisArg) { var this$1 = this; each(this.map, function (list, name) { each(list, function (value) { return callback.call(thisArg, value, name, this$1); }); }); }; function getName(map, name) { return Object.keys(map).reduce(function (prev, curr) { return toLower(name) === toLower(curr) ? curr : prev; }, null); } function normalizeName(name) { if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) { throw new TypeError('Invalid character in header field name'); } return trim(name); } /** * HTTP Response. */ var Response = function Response(body, ref) { var url = ref.url; var headers = ref.headers; var status = ref.status; var statusText = ref.statusText; this.url = url; this.ok = status >= 200 && status < 300; this.status = status || 0; this.statusText = statusText || ''; this.headers = new Headers(headers); this.body = body; if (isString(body)) { this.bodyText = body; } else if (isBlob(body)) { this.bodyBlob = body; if (isBlobText(body)) { this.bodyText = blobText(body); } } }; Response.prototype.blob = function blob () { return when(this.bodyBlob); }; Response.prototype.text = function text () { return when(this.bodyText); }; Response.prototype.json = function json () { return when(this.text(), function (text) { return JSON.parse(text); }); }; Object.defineProperty(Response.prototype, 'data', { get: function get() { return this.body; }, set: function set(body) { this.body = body; } }); function blobText(body) { return new PromiseObj(function (resolve) { var reader = new FileReader(); reader.readAsText(body); reader.onload = function () { resolve(reader.result); }; }); } function isBlobText(body) { return body.type.indexOf('text') === 0 || body.type.indexOf('json') !== -1; } /** * HTTP Request. */ var Request = function Request(options$$1) { this.body = null; this.params = {}; assign(this, options$$1, { method: toUpper(options$$1.method || 'GET') }); if (!(this.headers instanceof Headers)) { this.headers = new Headers(this.headers); } }; Request.prototype.getUrl = function getUrl () { return Url(this); }; Request.prototype.getBody = function getBody () { return this.body; }; Request.prototype.respondWith = function respondWith (body, options$$1) { return new Response(body, assign(options$$1 || {}, {url: this.getUrl()})); }; /** * Service for sending network requests. */ var COMMON_HEADERS = {'Accept': 'application/json, text/plain, */*'}; var JSON_CONTENT_TYPE = {'Content-Type': 'application/json;charset=utf-8'}; function Http(options$$1) { var self = this || {}, client = Client(self.$vm); defaults(options$$1 || {}, self.$options, Http.options); Http.interceptors.forEach(function (handler) { if (isString(handler)) { handler = Http.interceptor[handler]; } if (isFunction(handler)) { client.use(handler); } }); return client(new Request(options$$1)).then(function (response) { return response.ok ? response : PromiseObj.reject(response); }, function (response) { if (response instanceof Error) { error(response); } return PromiseObj.reject(response); }); } Http.options = {}; Http.headers = { put: JSON_CONTENT_TYPE, post: JSON_CONTENT_TYPE, patch: JSON_CONTENT_TYPE, delete: JSON_CONTENT_TYPE, common: COMMON_HEADERS, custom: {} }; Http.interceptor = {before: before, method: method, jsonp: jsonp, json: json, form: form, header: header, cors: cors}; Http.interceptors = ['before', 'method', 'jsonp', 'json', 'form', 'header', 'cors']; ['get', 'delete', 'head', 'jsonp'].forEach(function (method$$1) { Http[method$$1] = function (url, options$$1) { return this(assign(options$$1 || {}, {url: url, method: method$$1})); }; }); ['post', 'put', 'patch'].forEach(function (method$$1) { Http[method$$1] = function (url, body, options$$1) { return this(assign(options$$1 || {}, {url: url, method: method$$1, body: body})); }; }); /** * Service for interacting with RESTful services. */ function Resource(url, params, actions, options$$1) { var self = this || {}, resource = {}; actions = assign({}, Resource.actions, actions ); each(actions, function (action, name) { action = merge({url: url, params: assign({}, params)}, options$$1, action); resource[name] = function () { return (self.$http || Http)(opts(action, arguments)); }; }); return resource; } function opts(action, args) { var options$$1 = assign({}, action), params = {}, body; switch (args.length) { case 2: params = args[0]; body = args[1]; break; case 1: if (/^(POST|PUT|PATCH)$/i.test(options$$1.method)) { body = args[0]; } else { params = args[0]; } break; case 0: break; default: throw 'Expected up to 2 arguments [params, body], got ' + args.length + ' arguments'; } options$$1.body = body; options$$1.params = assign({}, options$$1.params, params); return options$$1; } Resource.actions = { get: {method: 'GET'}, save: {method: 'POST'}, query: {method: 'GET'}, update: {method: 'PUT'}, remove: {method: 'DELETE'}, delete: {method: 'DELETE'} }; /** * Install plugin. */ function plugin(Vue) { if (plugin.installed) { return; } Util(Vue); Vue.url = Url; Vue.http = Http; Vue.resource = Resource; Vue.Promise = PromiseObj; Object.defineProperties(Vue.prototype, { $url: { get: function get() { return options(Vue.url, this, this.$options.url); } }, $http: { get: function get() { return options(Vue.http, this, this.$options.http); } }, $resource: { get: function get() { return Vue.resource.bind(this); } }, $promise: { get: function get() { var this$1 = this; return function (executor) { return new Vue.Promise(executor, this$1); }; } } }); } if (typeof window !== 'undefined' && window.Vue) { window.Vue.use(plugin); } module.exports = plugin; },{"got":14}],19:[function(require,module,exports){ (function (global,setImmediate){ /*! * Vue.js v2.5.16 * (c) 2014-2018 Evan You * Released under the MIT License. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var y=Object.freeze({});function M(e){return null==e}function D(e){return null!=e}function S(e){return!0===e}function T(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function P(e){return null!==e&&"object"==typeof e}var r=Object.prototype.toString;function l(e){return"[object Object]"===r.call(e)}function i(e){var t=parseFloat(String(e));return 0<=t&&Math.floor(t)===t&&isFinite(e)}function t(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function F(e){var t=parseFloat(e);return isNaN(t)?e:t}function s(e,t){for(var n=Object.create(null),r=e.split(","),i=0;ie.id;)n--;bt.splice(n+1,0,e)}else bt.push(e);Ct||(Ct=!0,Ze(At))}}(this)},St.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||P(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Fe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},St.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},St.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},St.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||f(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var Tt={enumerable:!0,configurable:!0,get:$,set:$};function Et(e,t,n){Tt.get=function(){return this[t][n]},Tt.set=function(e){this[t][n]=e},Object.defineProperty(e,n,Tt)}function jt(e){e._watchers=[];var t=e.$options;t.props&&function(n,r){var i=n.$options.propsData||{},o=n._props={},a=n.$options._propKeys=[];n.$parent&&ge(!1);var e=function(e){a.push(e);var t=Ie(e,r,i,n);Ce(o,e,t),e in n||Et(n,"_props",e)};for(var t in r)e(t);ge(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?$:v(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;l(t=e._data="function"==typeof t?function(e,t){se();try{return e.call(t,t)}catch(e){return Fe(e,t,"data()"),{}}finally{ce()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);for(;i--;){var o=n[i];r&&p(r,o)||(void 0,36!==(a=(o+"").charCodeAt(0))&&95!==a&&Et(e,"_data",o))}var a;we(t,!0)}(e):we(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=Y();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new St(e,a||$,$,Nt)),i in e||Lt(e,i,o)}}(e,t.computed),t.watch&&t.watch!==G&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;iparseInt(this.max)&&bn(a,s[0],s,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};$n=hn,Cn={get:function(){return j}},Object.defineProperty($n,"config",Cn),$n.util={warn:re,extend:m,mergeOptions:Ne,defineReactive:Ce},$n.set=xe,$n.delete=ke,$n.nextTick=Ze,$n.options=Object.create(null),k.forEach(function(e){$n.options[e+"s"]=Object.create(null)}),m(($n.options._base=$n).options.components,kn),$n.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(-1=a&&l()};setTimeout(function(){c\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,oo="[a-zA-Z_][\\w\\-\\.]*",ao="((?:"+oo+"\\:)?"+oo+")",so=new RegExp("^<"+ao),co=/^\s*(\/?)>/,lo=new RegExp("^<\\/"+ao+"[^>]*>"),uo=/^]+>/i,fo=/^",""":'"',"&":"&"," ":"\n"," ":"\t"},go=/&(?:lt|gt|quot|amp);/g,_o=/&(?:lt|gt|quot|amp|#10|#9);/g,bo=s("pre,textarea",!0),$o=function(e,t){return e&&bo(e)&&"\n"===t[0]};var wo,Co,xo,ko,Ao,Oo,So,To,Eo=/^@|^v-on:/,jo=/^v-|^@|^:/,No=/([^]*?)\s+(?:in|of)\s+([^]*)/,Lo=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Io=/^\(|\)$/g,Mo=/:(.*)$/,Do=/^:|^v-bind:/,Po=/\.[^.]+/g,Fo=e(eo);function Ro(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:function(e){for(var t={},n=0,r=e.length;n]*>)","i")),n=i.replace(t,function(e,t,n){return r=n.length,ho(o)||"noscript"===o||(t=t.replace(//g,"$1").replace(//g,"$1")),$o(o,t)&&(t=t.slice(1)),d.chars&&d.chars(t),""});a+=i.length-n.length,i=n,A(o,a-r,a)}else{var s=i.indexOf("<");if(0===s){if(fo.test(i)){var c=i.indexOf("--\x3e");if(0<=c){d.shouldKeepComment&&d.comment(i.substring(4,c)),C(c+3);continue}}if(po.test(i)){var l=i.indexOf("]>");if(0<=l){C(l+2);continue}}var u=i.match(uo);if(u){C(u[0].length);continue}var f=i.match(lo);if(f){var p=a;C(f[0].length),A(f[1],p,a);continue}var _=x();if(_){k(_),$o(v,i)&&C(1);continue}}var b=void 0,$=void 0,w=void 0;if(0<=s){for($=i.slice(s);!(lo.test($)||so.test($)||fo.test($)||po.test($)||(w=$.indexOf("<",1))<0);)s+=w,$=i.slice(s);b=i.substring(0,s),C(s)}s<0&&(b=i,i=""),d.chars&&b&&d.chars(b)}if(i===e){d.chars&&d.chars(i);break}}function C(e){a+=e,i=i.substring(e)}function x(){var e=i.match(so);if(e){var t,n,r={tagName:e[1],attrs:[],start:a};for(C(e[0].length);!(t=i.match(co))&&(n=i.match(io));)C(n[0].length),r.attrs.push(n);if(t)return r.unarySlash=t[1],C(t[0].length),r.end=a,r}}function k(e){var t=e.tagName,n=e.unarySlash;m&&("p"===v&&ro(t)&&A(v),g(t)&&v===t&&A(t));for(var r,i,o,a=y(t)||!!n,s=e.attrs.length,c=new Array(s),l=0;l-1"+("true"===d?":("+l+")":":_q("+l+","+d+")")),Ar(c,"change","var $$a="+l+",$$el=$event.target,$$c=$$el.checked?("+d+"):("+v+");if(Array.isArray($$a)){var $$v="+(f?"_n("+p+")":p)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Er(l,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Er(l,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Er(l,"$$c")+"}",null,!0);else if("input"===$&&"radio"===w)r=e,i=_,a=(o=b)&&o.number,s=Or(r,"value")||"null",Cr(r,"checked","_q("+i+","+(s=a?"_n("+s+")":s)+")"),Ar(r,"change",Er(i,s),null,!0);else if("input"===$||"textarea"===$)!function(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,c=!o&&"range"!==r,l=o?"change":"range"===r?Pr:"input",u="$event.target.value";s&&(u="$event.target.value.trim()"),a&&(u="_n("+u+")");var f=Er(t,u);c&&(f="if($event.target.composing)return;"+f),Cr(e,"value","("+t+")"),Ar(e,l,f,null,!0),(s||a)&&Ar(e,"blur","$forceUpdate()")}(e,_,b);else if(!j.isReservedTag($))return Tr(e,_,b),!1;return!0},text:function(e,t){t.value&&Cr(e,"textContent","_s("+t.value+")")},html:function(e,t){t.value&&Cr(e,"innerHTML","_s("+t.value+")")}},isPreTag:function(e){return"pre"===e},isUnaryTag:to,mustUseProp:Sn,canBeLeftOpenTag:no,isReservedTag:Un,getTagNamespace:Vn,staticKeys:(Go=Wo,Go.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(","))},Qo=e(function(e){return s("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))});function ea(e,t){e&&(Zo=Qo(t.staticKeys||""),Xo=t.isReservedTag||O,function e(t){t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||c(e.tag)||!Xo(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(Zo)))}(t);if(1===t.type){if(!Xo(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*\(/,na=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,ra={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},ia={esc:"Escape",tab:"Tab",enter:"Enter",space:" ",up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete"]},oa=function(e){return"if("+e+")return null;"},aa={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:oa("$event.target !== $event.currentTarget"),ctrl:oa("!$event.ctrlKey"),shift:oa("!$event.shiftKey"),alt:oa("!$event.altKey"),meta:oa("!$event.metaKey"),left:oa("'button' in $event && $event.button !== 0"),middle:oa("'button' in $event && $event.button !== 1"),right:oa("'button' in $event && $event.button !== 2")};function sa(e,t,n){var r=t?"nativeOn:{":"on:{";for(var i in e)r+='"'+i+'":'+ca(i,e[i])+",";return r.slice(0,-1)+"}"}function ca(t,e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map(function(e){return ca(t,e)}).join(",")+"]";var n=na.test(e.value),r=ta.test(e.value);if(e.modifiers){var i="",o="",a=[];for(var s in e.modifiers)if(aa[s])o+=aa[s],ra[s]&&a.push(s);else if("exact"===s){var c=e.modifiers;o+=oa(["ctrl","shift","alt","meta"].filter(function(e){return!c[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);return a.length&&(i+="if(!('button' in $event)&&"+a.map(la).join("&&")+")return null;"),o&&(i+=o),"function($event){"+i+(n?"return "+e.value+"($event)":r?"return ("+e.value+")($event)":e.value)+"}"}return n||r?e.value:"function($event){"+e.value+"}"}function la(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=ra[e],r=ia[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var ua={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(t,n){t.wrapData=function(e){return"_b("+e+",'"+t.tag+"',"+n.value+","+(n.modifiers&&n.modifiers.prop?"true":"false")+(n.modifiers&&n.modifiers.sync?",true":"")+")"}},cloak:$},fa=function(e){this.options=e,this.warn=e.warn||$r,this.transforms=wr(e.modules,"transformCode"),this.dataGenFns=wr(e.modules,"genData"),this.directives=m(m({},ua),e.directives);var t=e.isReservedTag||O;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]};function pa(e,t){var n=new fa(t);return{render:"with(this){return "+(e?da(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function da(e,t){if(e.staticRoot&&!e.staticProcessed)return va(e,t);if(e.once&&!e.onceProcessed)return ha(e,t);if(e.for&&!e.forProcessed)return f=t,v=(u=e).for,h=u.alias,m=u.iterator1?","+u.iterator1:"",y=u.iterator2?","+u.iterator2:"",u.forProcessed=!0,(d||"_l")+"(("+v+"),function("+h+m+y+"){return "+(p||da)(u,f)+"})";if(e.if&&!e.ifProcessed)return ma(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=_a(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return g(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];!o&&!a||r||(i+=",null");o&&(i+=","+o);a&&(i+=(o?"":",null")+","+a);return i+")"}(e,t);var n;if(e.component)a=e.component,c=t,l=(s=e).inlineTemplate?null:_a(s,c,!0),n="_c("+a+","+ya(s,c)+(l?","+l:"")+")";else{var r=e.plain?void 0:ya(e,t),i=e.inlineTemplate?null:_a(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o':'
',0= 2) { Vue.mixin({ beforeCreate: vuexInit }); } else { // override init and inject vuex init procedure // for 1.x backwards compatibility. var _init = Vue.prototype._init; Vue.prototype._init = function (options) { if ( options === void 0 ) options = {}; options.init = options.init ? [vuexInit].concat(options.init) : vuexInit; _init.call(this, options); }; } /** * Vuex init hook, injected into each instances init hooks list. */ function vuexInit () { var options = this.$options; // store injection if (options.store) { this.$store = typeof options.store === 'function' ? options.store() : options.store; } else if (options.parent && options.parent.$store) { this.$store = options.parent.$store; } } }; var devtoolHook = typeof window !== 'undefined' && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; function devtoolPlugin (store) { if (!devtoolHook) { return } store._devtoolHook = devtoolHook; devtoolHook.emit('vuex:init', store); devtoolHook.on('vuex:travel-to-state', function (targetState) { store.replaceState(targetState); }); store.subscribe(function (mutation, state) { devtoolHook.emit('vuex:mutation', mutation, state); }); } /** * Get the first item that pass the test * by second argument function * * @param {Array} list * @param {Function} f * @return {*} */ /** * Deep copy the given object considering circular structure. * This function caches all nested objects and its copies. * If it detects circular structure, use cached copy to avoid infinite loop. * * @param {*} obj * @param {Array} cache * @return {*} */ /** * forEach for object */ function forEachValue (obj, fn) { Object.keys(obj).forEach(function (key) { return fn(obj[key], key); }); } function isObject (obj) { return obj !== null && typeof obj === 'object' } function isPromise (val) { return val && typeof val.then === 'function' } function assert (condition, msg) { if (!condition) { throw new Error(("[vuex] " + msg)) } } var Module = function Module (rawModule, runtime) { this.runtime = runtime; this._children = Object.create(null); this._rawModule = rawModule; var rawState = rawModule.state; this.state = (typeof rawState === 'function' ? rawState() : rawState) || {}; }; var prototypeAccessors$1 = { namespaced: { configurable: true } }; prototypeAccessors$1.namespaced.get = function () { return !!this._rawModule.namespaced }; Module.prototype.addChild = function addChild (key, module) { this._children[key] = module; }; Module.prototype.removeChild = function removeChild (key) { delete this._children[key]; }; Module.prototype.getChild = function getChild (key) { return this._children[key] }; Module.prototype.update = function update (rawModule) { this._rawModule.namespaced = rawModule.namespaced; if (rawModule.actions) { this._rawModule.actions = rawModule.actions; } if (rawModule.mutations) { this._rawModule.mutations = rawModule.mutations; } if (rawModule.getters) { this._rawModule.getters = rawModule.getters; } }; Module.prototype.forEachChild = function forEachChild (fn) { forEachValue(this._children, fn); }; Module.prototype.forEachGetter = function forEachGetter (fn) { if (this._rawModule.getters) { forEachValue(this._rawModule.getters, fn); } }; Module.prototype.forEachAction = function forEachAction (fn) { if (this._rawModule.actions) { forEachValue(this._rawModule.actions, fn); } }; Module.prototype.forEachMutation = function forEachMutation (fn) { if (this._rawModule.mutations) { forEachValue(this._rawModule.mutations, fn); } }; Object.defineProperties( Module.prototype, prototypeAccessors$1 ); var ModuleCollection = function ModuleCollection (rawRootModule) { // register root module (Vuex.Store options) this.register([], rawRootModule, false); }; ModuleCollection.prototype.get = function get (path) { return path.reduce(function (module, key) { return module.getChild(key) }, this.root) }; ModuleCollection.prototype.getNamespace = function getNamespace (path) { var module = this.root; return path.reduce(function (namespace, key) { module = module.getChild(key); return namespace + (module.namespaced ? key + '/' : '') }, '') }; ModuleCollection.prototype.update = function update$1 (rawRootModule) { update([], this.root, rawRootModule); }; ModuleCollection.prototype.register = function register (path, rawModule, runtime) { var this$1 = this; if ( runtime === void 0 ) runtime = true; if (process.env.NODE_ENV !== 'production') { assertRawModule(path, rawModule); } var newModule = new Module(rawModule, runtime); if (path.length === 0) { this.root = newModule; } else { var parent = this.get(path.slice(0, -1)); parent.addChild(path[path.length - 1], newModule); } // register nested modules if (rawModule.modules) { forEachValue(rawModule.modules, function (rawChildModule, key) { this$1.register(path.concat(key), rawChildModule, runtime); }); } }; ModuleCollection.prototype.unregister = function unregister (path) { var parent = this.get(path.slice(0, -1)); var key = path[path.length - 1]; if (!parent.getChild(key).runtime) { return } parent.removeChild(key); }; function update (path, targetModule, newModule) { if (process.env.NODE_ENV !== 'production') { assertRawModule(path, newModule); } // update target module targetModule.update(newModule); // update nested modules if (newModule.modules) { for (var key in newModule.modules) { if (!targetModule.getChild(key)) { if (process.env.NODE_ENV !== 'production') { console.warn( "[vuex] trying to add a new module '" + key + "' on hot reloading, " + 'manual reload is needed' ); } return } update( path.concat(key), targetModule.getChild(key), newModule.modules[key] ); } } } var functionAssert = { assert: function (value) { return typeof value === 'function'; }, expected: 'function' }; var objectAssert = { assert: function (value) { return typeof value === 'function' || (typeof value === 'object' && typeof value.handler === 'function'); }, expected: 'function or object with "handler" function' }; var assertTypes = { getters: functionAssert, mutations: functionAssert, actions: objectAssert }; function assertRawModule (path, rawModule) { Object.keys(assertTypes).forEach(function (key) { if (!rawModule[key]) { return } var assertOptions = assertTypes[key]; forEachValue(rawModule[key], function (value, type) { assert( assertOptions.assert(value), makeAssertionMessage(path, key, type, value, assertOptions.expected) ); }); }); } function makeAssertionMessage (path, key, type, value, expected) { var buf = key + " should be " + expected + " but \"" + key + "." + type + "\""; if (path.length > 0) { buf += " in module \"" + (path.join('.')) + "\""; } buf += " is " + (JSON.stringify(value)) + "."; return buf } var Vue; // bind on install var Store = function Store (options) { var this$1 = this; if ( options === void 0 ) options = {}; // Auto install if it is not done yet and `window` has `Vue`. // To allow users to avoid auto-installation in some cases, // this code should be placed here. See #731 if (!Vue && typeof window !== 'undefined' && window.Vue) { install(window.Vue); } if (process.env.NODE_ENV !== 'production') { assert(Vue, "must call Vue.use(Vuex) before creating a store instance."); assert(typeof Promise !== 'undefined', "vuex requires a Promise polyfill in this browser."); assert(this instanceof Store, "Store must be called with the new operator."); } var plugins = options.plugins; if ( plugins === void 0 ) plugins = []; var strict = options.strict; if ( strict === void 0 ) strict = false; var state = options.state; if ( state === void 0 ) state = {}; if (typeof state === 'function') { state = state() || {}; } // store internal state this._committing = false; this._actions = Object.create(null); this._actionSubscribers = []; this._mutations = Object.create(null); this._wrappedGetters = Object.create(null); this._modules = new ModuleCollection(options); this._modulesNamespaceMap = Object.create(null); this._subscribers = []; this._watcherVM = new Vue(); // bind commit and dispatch to self var store = this; var ref = this; var dispatch = ref.dispatch; var commit = ref.commit; this.dispatch = function boundDispatch (type, payload) { return dispatch.call(store, type, payload) }; this.commit = function boundCommit (type, payload, options) { return commit.call(store, type, payload, options) }; // strict mode this.strict = strict; // init root module. // this also recursively registers all sub-modules // and collects all module getters inside this._wrappedGetters installModule(this, state, [], this._modules.root); // initialize the store vm, which is responsible for the reactivity // (also registers _wrappedGetters as computed properties) resetStoreVM(this, state); // apply plugins plugins.forEach(function (plugin) { return plugin(this$1); }); if (Vue.config.devtools) { devtoolPlugin(this); } }; var prototypeAccessors = { state: { configurable: true } }; prototypeAccessors.state.get = function () { return this._vm._data.$$state }; prototypeAccessors.state.set = function (v) { if (process.env.NODE_ENV !== 'production') { assert(false, "Use store.replaceState() to explicit replace store state."); } }; Store.prototype.commit = function commit (_type, _payload, _options) { var this$1 = this; // check object-style commit var ref = unifyObjectStyle(_type, _payload, _options); var type = ref.type; var payload = ref.payload; var options = ref.options; var mutation = { type: type, payload: payload }; var entry = this._mutations[type]; if (!entry) { if (process.env.NODE_ENV !== 'production') { console.error(("[vuex] unknown mutation type: " + type)); } return } this._withCommit(function () { entry.forEach(function commitIterator (handler) { handler(payload); }); }); this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); }); if ( process.env.NODE_ENV !== 'production' && options && options.silent ) { console.warn( "[vuex] mutation type: " + type + ". Silent option has been removed. " + 'Use the filter functionality in the vue-devtools' ); } }; Store.prototype.dispatch = function dispatch (_type, _payload) { var this$1 = this; // check object-style dispatch var ref = unifyObjectStyle(_type, _payload); var type = ref.type; var payload = ref.payload; var action = { type: type, payload: payload }; var entry = this._actions[type]; if (!entry) { if (process.env.NODE_ENV !== 'production') { console.error(("[vuex] unknown action type: " + type)); } return } this._actionSubscribers.forEach(function (sub) { return sub(action, this$1.state); }); return entry.length > 1 ? Promise.all(entry.map(function (handler) { return handler(payload); })) : entry[0](payload) }; Store.prototype.subscribe = function subscribe (fn) { return genericSubscribe(fn, this._subscribers) }; Store.prototype.subscribeAction = function subscribeAction (fn) { return genericSubscribe(fn, this._actionSubscribers) }; Store.prototype.watch = function watch (getter, cb, options) { var this$1 = this; if (process.env.NODE_ENV !== 'production') { assert(typeof getter === 'function', "store.watch only accepts a function."); } return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options) }; Store.prototype.replaceState = function replaceState (state) { var this$1 = this; this._withCommit(function () { this$1._vm._data.$$state = state; }); }; Store.prototype.registerModule = function registerModule (path, rawModule, options) { if ( options === void 0 ) options = {}; if (typeof path === 'string') { path = [path]; } if (process.env.NODE_ENV !== 'production') { assert(Array.isArray(path), "module path must be a string or an Array."); assert(path.length > 0, 'cannot register the root module by using registerModule.'); } this._modules.register(path, rawModule); installModule(this, this.state, path, this._modules.get(path), options.preserveState); // reset store to update getters... resetStoreVM(this, this.state); }; Store.prototype.unregisterModule = function unregisterModule (path) { var this$1 = this; if (typeof path === 'string') { path = [path]; } if (process.env.NODE_ENV !== 'production') { assert(Array.isArray(path), "module path must be a string or an Array."); } this._modules.unregister(path); this._withCommit(function () { var parentState = getNestedState(this$1.state, path.slice(0, -1)); Vue.delete(parentState, path[path.length - 1]); }); resetStore(this); }; Store.prototype.hotUpdate = function hotUpdate (newOptions) { this._modules.update(newOptions); resetStore(this, true); }; Store.prototype._withCommit = function _withCommit (fn) { var committing = this._committing; this._committing = true; fn(); this._committing = committing; }; Object.defineProperties( Store.prototype, prototypeAccessors ); function genericSubscribe (fn, subs) { if (subs.indexOf(fn) < 0) { subs.push(fn); } return function () { var i = subs.indexOf(fn); if (i > -1) { subs.splice(i, 1); } } } function resetStore (store, hot) { store._actions = Object.create(null); store._mutations = Object.create(null); store._wrappedGetters = Object.create(null); store._modulesNamespaceMap = Object.create(null); var state = store.state; // init all modules installModule(store, state, [], store._modules.root, true); // reset vm resetStoreVM(store, state, hot); } function resetStoreVM (store, state, hot) { var oldVm = store._vm; // bind store public getters store.getters = {}; var wrappedGetters = store._wrappedGetters; var computed = {}; forEachValue(wrappedGetters, function (fn, key) { // use computed to leverage its lazy-caching mechanism computed[key] = function () { return fn(store); }; Object.defineProperty(store.getters, key, { get: function () { return store._vm[key]; }, enumerable: true // for local getters }); }); // use a Vue instance to store the state tree // suppress warnings just in case the user has added // some funky global mixins var silent = Vue.config.silent; Vue.config.silent = true; store._vm = new Vue({ data: { $$state: state }, computed: computed }); Vue.config.silent = silent; // enable strict mode for new vm if (store.strict) { enableStrictMode(store); } if (oldVm) { if (hot) { // dispatch changes in all subscribed watchers // to force getter re-evaluation for hot reloading. store._withCommit(function () { oldVm._data.$$state = null; }); } Vue.nextTick(function () { return oldVm.$destroy(); }); } } function installModule (store, rootState, path, module, hot) { var isRoot = !path.length; var namespace = store._modules.getNamespace(path); // register in namespace map if (module.namespaced) { store._modulesNamespaceMap[namespace] = module; } // set state if (!isRoot && !hot) { var parentState = getNestedState(rootState, path.slice(0, -1)); var moduleName = path[path.length - 1]; store._withCommit(function () { Vue.set(parentState, moduleName, module.state); }); } var local = module.context = makeLocalContext(store, namespace, path); module.forEachMutation(function (mutation, key) { var namespacedType = namespace + key; registerMutation(store, namespacedType, mutation, local); }); module.forEachAction(function (action, key) { var type = action.root ? key : namespace + key; var handler = action.handler || action; registerAction(store, type, handler, local); }); module.forEachGetter(function (getter, key) { var namespacedType = namespace + key; registerGetter(store, namespacedType, getter, local); }); module.forEachChild(function (child, key) { installModule(store, rootState, path.concat(key), child, hot); }); } /** * make localized dispatch, commit, getters and state * if there is no namespace, just use root ones */ function makeLocalContext (store, namespace, path) { var noNamespace = namespace === ''; var local = { dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) { var args = unifyObjectStyle(_type, _payload, _options); var payload = args.payload; var options = args.options; var type = args.type; if (!options || !options.root) { type = namespace + type; if (process.env.NODE_ENV !== 'production' && !store._actions[type]) { console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type)); return } } return store.dispatch(type, payload) }, commit: noNamespace ? store.commit : function (_type, _payload, _options) { var args = unifyObjectStyle(_type, _payload, _options); var payload = args.payload; var options = args.options; var type = args.type; if (!options || !options.root) { type = namespace + type; if (process.env.NODE_ENV !== 'production' && !store._mutations[type]) { console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type)); return } } store.commit(type, payload, options); } }; // getters and state object must be gotten lazily // because they will be changed by vm update Object.defineProperties(local, { getters: { get: noNamespace ? function () { return store.getters; } : function () { return makeLocalGetters(store, namespace); } }, state: { get: function () { return getNestedState(store.state, path); } } }); return local } function makeLocalGetters (store, namespace) { var gettersProxy = {}; var splitPos = namespace.length; Object.keys(store.getters).forEach(function (type) { // skip if the target getter is not match this namespace if (type.slice(0, splitPos) !== namespace) { return } // extract local getter type var localType = type.slice(splitPos); // Add a port to the getters proxy. // Define as getter property because // we do not want to evaluate the getters in this time. Object.defineProperty(gettersProxy, localType, { get: function () { return store.getters[type]; }, enumerable: true }); }); return gettersProxy } function registerMutation (store, type, handler, local) { var entry = store._mutations[type] || (store._mutations[type] = []); entry.push(function wrappedMutationHandler (payload) { handler.call(store, local.state, payload); }); } function registerAction (store, type, handler, local) { var entry = store._actions[type] || (store._actions[type] = []); entry.push(function wrappedActionHandler (payload, cb) { var res = handler.call(store, { dispatch: local.dispatch, commit: local.commit, getters: local.getters, state: local.state, rootGetters: store.getters, rootState: store.state }, payload, cb); if (!isPromise(res)) { res = Promise.resolve(res); } if (store._devtoolHook) { return res.catch(function (err) { store._devtoolHook.emit('vuex:error', err); throw err }) } else { return res } }); } function registerGetter (store, type, rawGetter, local) { if (store._wrappedGetters[type]) { if (process.env.NODE_ENV !== 'production') { console.error(("[vuex] duplicate getter key: " + type)); } return } store._wrappedGetters[type] = function wrappedGetter (store) { return rawGetter( local.state, // local state local.getters, // local getters store.state, // root state store.getters // root getters ) }; } function enableStrictMode (store) { store._vm.$watch(function () { return this._data.$$state }, function () { if (process.env.NODE_ENV !== 'production') { assert(store._committing, "Do not mutate vuex store state outside mutation handlers."); } }, { deep: true, sync: true }); } function getNestedState (state, path) { return path.length ? path.reduce(function (state, key) { return state[key]; }, state) : state } function unifyObjectStyle (type, payload, options) { if (isObject(type) && type.type) { options = payload; payload = type; type = type.type; } if (process.env.NODE_ENV !== 'production') { assert(typeof type === 'string', ("Expects string as the type, but found " + (typeof type) + ".")); } return { type: type, payload: payload, options: options } } function install (_Vue) { if (Vue && _Vue === Vue) { if (process.env.NODE_ENV !== 'production') { console.error( '[vuex] already installed. Vue.use(Vuex) should be called only once.' ); } return } Vue = _Vue; applyMixin(Vue); } var mapState = normalizeNamespace(function (namespace, states) { var res = {}; normalizeMap(states).forEach(function (ref) { var key = ref.key; var val = ref.val; res[key] = function mappedState () { var state = this.$store.state; var getters = this.$store.getters; if (namespace) { var module = getModuleByNamespace(this.$store, 'mapState', namespace); if (!module) { return } state = module.context.state; getters = module.context.getters; } return typeof val === 'function' ? val.call(this, state, getters) : state[val] }; // mark vuex getter for devtools res[key].vuex = true; }); return res }); var mapMutations = normalizeNamespace(function (namespace, mutations) { var res = {}; normalizeMap(mutations).forEach(function (ref) { var key = ref.key; var val = ref.val; res[key] = function mappedMutation () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; var commit = this.$store.commit; if (namespace) { var module = getModuleByNamespace(this.$store, 'mapMutations', namespace); if (!module) { return } commit = module.context.commit; } return typeof val === 'function' ? val.apply(this, [commit].concat(args)) : commit.apply(this.$store, [val].concat(args)) }; }); return res }); var mapGetters = normalizeNamespace(function (namespace, getters) { var res = {}; normalizeMap(getters).forEach(function (ref) { var key = ref.key; var val = ref.val; val = namespace + val; res[key] = function mappedGetter () { if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) { return } if (process.env.NODE_ENV !== 'production' && !(val in this.$store.getters)) { console.error(("[vuex] unknown getter: " + val)); return } return this.$store.getters[val] }; // mark vuex getter for devtools res[key].vuex = true; }); return res }); var mapActions = normalizeNamespace(function (namespace, actions) { var res = {}; normalizeMap(actions).forEach(function (ref) { var key = ref.key; var val = ref.val; res[key] = function mappedAction () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; var dispatch = this.$store.dispatch; if (namespace) { var module = getModuleByNamespace(this.$store, 'mapActions', namespace); if (!module) { return } dispatch = module.context.dispatch; } return typeof val === 'function' ? val.apply(this, [dispatch].concat(args)) : dispatch.apply(this.$store, [val].concat(args)) }; }); return res }); var createNamespacedHelpers = function (namespace) { return ({ mapState: mapState.bind(null, namespace), mapGetters: mapGetters.bind(null, namespace), mapMutations: mapMutations.bind(null, namespace), mapActions: mapActions.bind(null, namespace) }); }; function normalizeMap (map) { return Array.isArray(map) ? map.map(function (key) { return ({ key: key, val: key }); }) : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); }) } function normalizeNamespace (fn) { return function (namespace, map) { if (typeof namespace !== 'string') { map = namespace; namespace = ''; } else if (namespace.charAt(namespace.length - 1) !== '/') { namespace += '/'; } return fn(namespace, map) } } function getModuleByNamespace (store, helper, namespace) { var module = store._modulesNamespaceMap[namespace]; if (process.env.NODE_ENV !== 'production' && !module) { console.error(("[vuex] module namespace not found in " + helper + "(): " + namespace)); } return module } var index = { Store: Store, install: install, version: '3.0.1', mapState: mapState, mapMutations: mapMutations, mapGetters: mapGetters, mapActions: mapActions, createNamespacedHelpers: createNamespacedHelpers }; module.exports = index; }).call(this,require('_process')) },{"_process":15}]},{},[12]);