diff --git a/config/sync/core.extension.yml b/config/sync/core.extension.yml index df83a4c..22bcebb 100644 --- a/config/sync/core.extension.yml +++ b/config/sync/core.extension.yml @@ -190,6 +190,7 @@ module: filefield_sources: 1 menu_admin_per_menu: 1 menu_link_content: 1 + pathauto: 1 content_translation: 10 views: 10 materio_id: 11 diff --git a/package-lock.json b/package-lock.json index ef71624..6bcbc36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5348,7 +5348,8 @@ "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true }, "define-properties": { "version": "1.1.3", @@ -11807,6 +11808,7 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/vue-meta/-/vue-meta-2.4.0.tgz", "integrity": "sha512-XEeZUmlVeODclAjCNpWDnjgw+t3WA6gdzs6ENoIAgwO1J1d5p1tezDhtteLUFwcaQaTtayRrsx7GL6oXp/m2Jw==", + "dev": true, "requires": { "deepmerge": "^4.2.2" } diff --git a/package.json b/package.json index 2a32ba5..13e0829 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "vue-autofocus-directive": "^1.0.4", "vue-cool-lightbox": "^2.6.9", "vue-infinite-loading": "^2.4.5", - "vue-meta": "^2.4.0", "vue-router": "^3.4.9", "vue-vimeo-player": "^0.1.0", "vue-youtube-embed": "^2.2.2", @@ -68,6 +67,7 @@ "vue-jest": "^3.0.7", "vue-js-modal": "^2.0.0-rc.6", "vue-loader": "^15.9.5", + "vue-meta": "^2.4.0", "vue-server-renderer": "^2.6.12", "vue-style-loader": "^4.1.2", "vue-template-compiler": "^2.6.12", diff --git a/web/themes/custom/materiotheme/assets/dist/main.js b/web/themes/custom/materiotheme/assets/dist/main.js index 1e2c298..1391664 100644 --- a/web/themes/custom/materiotheme/assets/dist/main.js +++ b/web/themes/custom/materiotheme/assets/dist/main.js @@ -364,6 +364,19 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ }), +/***/ "./node_modules/deepmerge/dist/cjs.js": +/*!********************************************!*\ + !*** ./node_modules/deepmerge/dist/cjs.js ***! + \********************************************/ +/*! unknown exports (runtime-defined) */ +/*! runtime requirements: module */ +/***/ ((module) => { + +"use strict"; +eval("\n\nvar isMergeableObject = function isMergeableObject(value) {\n return isNonNullObject(value) && !isSpecial(value);\n};\n\nfunction isNonNullObject(value) {\n return !!value && typeof value === 'object';\n}\n\nfunction isSpecial(value) {\n var stringValue = Object.prototype.toString.call(value);\n return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value);\n} // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25\n\n\nvar canUseSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;\n\nfunction isReactElement(value) {\n return value.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nfunction emptyTarget(val) {\n return Array.isArray(val) ? [] : {};\n}\n\nfunction cloneUnlessOtherwiseSpecified(value, options) {\n return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;\n}\n\nfunction defaultArrayMerge(target, source, options) {\n return target.concat(source).map(function (element) {\n return cloneUnlessOtherwiseSpecified(element, options);\n });\n}\n\nfunction getMergeFunction(key, options) {\n if (!options.customMerge) {\n return deepmerge;\n }\n\n var customMerge = options.customMerge(key);\n return typeof customMerge === 'function' ? customMerge : deepmerge;\n}\n\nfunction getEnumerableOwnPropertySymbols(target) {\n return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function (symbol) {\n return target.propertyIsEnumerable(symbol);\n }) : [];\n}\n\nfunction getKeys(target) {\n return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));\n}\n\nfunction propertyIsOnObject(object, property) {\n try {\n return property in object;\n } catch (_) {\n return false;\n }\n} // Protects from prototype poisoning and unexpected merging up the prototype chain.\n\n\nfunction propertyIsUnsafe(target, key) {\n return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,\n && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,\n && Object.propertyIsEnumerable.call(target, key)); // and also unsafe if they're nonenumerable.\n}\n\nfunction mergeObject(target, source, options) {\n var destination = {};\n\n if (options.isMergeableObject(target)) {\n getKeys(target).forEach(function (key) {\n destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);\n });\n }\n\n getKeys(source).forEach(function (key) {\n if (propertyIsUnsafe(target, key)) {\n return;\n }\n\n if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {\n destination[key] = getMergeFunction(key, options)(target[key], source[key], options);\n } else {\n destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);\n }\n });\n return destination;\n}\n\nfunction deepmerge(target, source, options) {\n options = options || {};\n options.arrayMerge = options.arrayMerge || defaultArrayMerge;\n options.isMergeableObject = options.isMergeableObject || isMergeableObject; // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()\n // implementations can use it. The caller may not replace it.\n\n options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;\n var sourceIsArray = Array.isArray(source);\n var targetIsArray = Array.isArray(target);\n var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;\n\n if (!sourceAndTargetTypesMatch) {\n return cloneUnlessOtherwiseSpecified(source, options);\n } else if (sourceIsArray) {\n return options.arrayMerge(target, source, options);\n } else {\n return mergeObject(target, source, options);\n }\n}\n\ndeepmerge.all = function deepmergeAll(array, options) {\n if (!Array.isArray(array)) {\n throw new Error('first argument should be an array');\n }\n\n return array.reduce(function (prev, next) {\n return deepmerge(prev, next, options);\n }, {});\n};\n\nvar deepmerge_1 = deepmerge;\nmodule.exports = deepmerge_1;\n\n//# sourceURL=webpack://materio.com/./node_modules/deepmerge/dist/cjs.js?"); + +/***/ }), + /***/ "./node_modules/graphql-tag/src/index.js": /*!***********************************************!*\ !*** ./node_modules/graphql-tag/src/index.js ***! @@ -1129,7 +1142,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nvar _store = _interopRequireDefault(__webpack_require__(/*! vuejs/store */ \"./web/themes/custom/materiotheme/vuejs/store/index.js\"));\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _graphqlAxios = __webpack_require__(/*! vuejs/api/graphql-axios */ \"./web/themes/custom/materiotheme/vuejs/api/graphql-axios.js\");\n\nvar _printer = __webpack_require__(/*! graphql/language/printer */ \"./node_modules/graphql/language/printer.js\");\n\nvar _graphqlTag = _interopRequireDefault(__webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\"));\n\nvar _articleFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/article.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql\"));\n\nvar _Card = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/Card */ \"./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _wrapRegExp(re, groups) { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = _RegExp.call(this, re, flags); _groups.set(_this, groups || _groups.get(re)); return _this; } _inherits(BabelRegExp, _RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === \"string\") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\\$<([^>]+)>/g, function (_, name) { return \"$\" + groups[name]; })); } else if (typeof substitution === \"function\") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = []; args.push.apply(args, arguments); if (_typeof(args[args.length - 1]) !== \"object\") { args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n route(path: \\\"\", \"\\\") {\\n ...ArticleFields\\n }\\n }\\n \", \"\\n \"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Article\",\n router: _route.default,\n store: _store.default,\n props: ['item'],\n data: function data() {\n return {\n index: -1,\n prevnext: {},\n nid: null,\n path: null,\n article: null,\n image_accroche: null,\n lightbox_items: null,\n loading: true,\n lightbox_index: null\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n items: function items(state) {\n return state.Blabla.items;\n }\n })),\n created: function created() {\n this.getArticle();\n },\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n getItems: 'Blabla/getItems',\n getItemIndex: 'Blabla/getItemIndex',\n getPrevNextItems: 'Blabla/getPrevNextItems'\n })), {}, {\n getArticle: function getArticle() {\n var _this = this;\n\n console.log(this.$route); // get the article uuid\n // if(this.$route.query.nid){\n // // we come from internal link with vuejs\n // // directly record uuid\n // this.nid = this.$route.query.nid\n //\n // }else if(drupalDecoupled.entity_type == 'node' && drupalDecoupled.entity_bundle == 'article'){\n // // we landed in an internal page\n // // get the uuid from drupalDeclouped, provided by materio_decoupled.module\n // this.nid = drupalDecoupled.entity_id\n // }\n\n if (this.$route.path) {\n // we come from internal link with vuejs\n this.path = this.$route.path;\n } else {\n // we landed in an internal page\n this.path = window.location.pathname;\n }\n\n if (this.path) {\n this.loadArticle(); // get the prev next items\n\n if (!this.items.length) {\n // if items list not yet loaded preload them\n this.getItems().then(function () {\n // then get the index\n _this.getIndex();\n });\n } else {\n // or directly get the index\n this.getIndex();\n }\n } else {\n // if for any reason we dont have the uuid\n // redirect to home\n this.$route.replace('home');\n }\n },\n getIndex: function getIndex() {\n var _this2 = this;\n\n console.log(\"Article getIndex\");\n this.getItemIndex(this.nid).then(function (index) {\n _this2.index = index; // console.log('article index', index, this);\n\n _this2.getPrevNextItems(index).then(function (pn) {\n _this2.prevnext = pn;\n });\n });\n },\n loadArticle: function loadArticle() {\n var _this3 = this;\n\n console.log('loadArticle');\n this.loading = true; // let ast = gql`{\n // article(id: ${this.nid}) {\n // ...ArticleFields\n // }\n // }\n // ${ articleFields }\n // `\n\n var ast = (0, _graphqlTag.default)(_templateObject(), this.path, _articleFragment.default);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (_ref) {\n var route = _ref.data.data.route;\n console.log('loadArticle', route);\n\n _this3.parseDataGQL(route);\n }).catch(function (error) {\n console.warn('Issue with loadArticle', error);\n Promise.reject(error);\n });\n },\n parseDataGQL: function parseDataGQL(article) {\n console.log('parseDataGQL article', article);\n this.article = article;\n this.image_accroche = article.images[0];\n this.lightbox_items = []; // fill the lightbox\n\n for (var i = 0; i < article.images.length; i++) {\n article.images[i].thumb = article.images[i].style_articlecardmedium.url;\n this.lightbox_items.push(article.images[i]);\n } // parse embeded videos pushing it in lightbox\n\n\n for (var i = 0; i < article.videos.length; i++) {\n var videoUrl = article.videos[i].url;\n\n var provider_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?(youtube|vimeo)\\.com\\/.+/, {\n provider: 2\n });\n\n var match = provider_regex.exec(videoUrl); // console.log('provider', match.groups.provider);\n\n var video_id = null;\n var video_thumb = null;\n\n switch (match.groups.provider) {\n case 'vimeo':\n var vimeo_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/vimeo\\.com\\/([0-9]+)/, {\n id: 1\n });\n\n video_id = vimeo_regex.exec(videoUrl).groups.id || null; // TODO: get the vimeo thumb https://coderwall.com/p/fdrdmg/get-a-thumbnail-from-a-vimeo-video\n\n video_thumb = \"http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png\";\n break;\n\n case 'youtube':\n var youtube_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=(.+)/, {\n id: 2\n });\n\n video_id = youtube_regex.exec(videoUrl).groups.id || null;\n video_thumb = \"http://img.youtube.com/vi/\" + video_id + \"/0.jpg\";\n break;\n } // console.log('video_id', video_id);\n\n\n this.lightbox_items.push({\n url: videoUrl,\n title: \"\",\n description: \"\",\n thumb: video_thumb\n });\n }\n\n console.log('this.content.lightbox_items', this.lightbox_items); // update main page title\n\n this.$store.commit('Common/setPagetitle', article.title);\n this.loading = false;\n },\n onNext: function onNext() {\n // console.log('clicked on next', this.prevnext.next);\n var alias = this.prevnext.next.view_node.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n },\n query: {\n uuid: this.prevnext.next.uuid\n }\n });\n },\n onPrev: function onPrev() {\n // console.log('clicked on prev', this.prevnext.next);\n var alias = this.prevnext.prev.view_node.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n },\n query: {\n uuid: this.prevnext.prev.uuid\n }\n });\n },\n setLightboxIndex: function setLightboxIndex(index) {\n this.lightbox_index = index;\n }\n }),\n components: {\n Card: _Card.default\n },\n watch: {\n '$route': function $route(to, from) {\n console.log('route change');\n this.getArticle();\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nvar _store = _interopRequireDefault(__webpack_require__(/*! vuejs/store */ \"./web/themes/custom/materiotheme/vuejs/store/index.js\"));\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\nvar _graphqlAxios = __webpack_require__(/*! vuejs/api/graphql-axios */ \"./web/themes/custom/materiotheme/vuejs/api/graphql-axios.js\");\n\nvar _printer = __webpack_require__(/*! graphql/language/printer */ \"./node_modules/graphql/language/printer.js\");\n\nvar _graphqlTag = _interopRequireDefault(__webpack_require__(/*! graphql-tag */ \"./node_modules/graphql-tag/src/index.js\"));\n\nvar _articleFragment = _interopRequireDefault(__webpack_require__(/*! vuejs/api/gql/article.fragment.gql */ \"./web/themes/custom/materiotheme/vuejs/api/gql/article.fragment.gql\"));\n\nvar _Card = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/Card */ \"./web/themes/custom/materiotheme/vuejs/components/Content/Card.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _wrapRegExp(re, groups) { _wrapRegExp = function _wrapRegExp(re, groups) { return new BabelRegExp(re, undefined, groups); }; var _RegExp = _wrapNativeSuper(RegExp); var _super = RegExp.prototype; var _groups = new WeakMap(); function BabelRegExp(re, flags, groups) { var _this = _RegExp.call(this, re, flags); _groups.set(_this, groups || _groups.get(re)); return _this; } _inherits(BabelRegExp, _RegExp); BabelRegExp.prototype.exec = function (str) { var result = _super.exec.call(this, str); if (result) result.groups = buildGroups(result, this); return result; }; BabelRegExp.prototype[Symbol.replace] = function (str, substitution) { if (typeof substitution === \"string\") { var groups = _groups.get(this); return _super[Symbol.replace].call(this, str, substitution.replace(/\\$<([^>]+)>/g, function (_, name) { return \"$\" + groups[name]; })); } else if (typeof substitution === \"function\") { var _this = this; return _super[Symbol.replace].call(this, str, function () { var args = []; args.push.apply(args, arguments); if (_typeof(args[args.length - 1]) !== \"object\") { args.push(buildGroups(args, _this)); } return substitution.apply(this, args); }); } else { return _super[Symbol.replace].call(this, str, substitution); } }; function buildGroups(result, re) { var g = _groups.get(re); return Object.keys(g).reduce(function (groups, name) { groups[name] = result[g[name]]; return groups; }, Object.create(null)); } return _wrapRegExp.apply(this, arguments); }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nfunction _templateObject() {\n var data = _taggedTemplateLiteral([\"{\\n route(path: \\\"\", \"\\\") {\\n ...ArticleFields\\n }\\n }\\n \", \"\\n \"]);\n\n _templateObject = function _templateObject() {\n return data;\n };\n\n return data;\n}\n\nfunction _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar _default = {\n name: \"Article\",\n router: _route.default,\n store: _store.default,\n props: ['item'],\n data: function data() {\n return {\n index: -1,\n prevnext: {},\n nid: null,\n path: null,\n article: {},\n image_accroche: null,\n lightbox_items: null,\n loading: true,\n lightbox_index: null\n };\n },\n metaInfo: function metaInfo() {\n return {\n title: this.article.title\n };\n },\n computed: _objectSpread({}, (0, _vuex.mapState)({\n items: function items(state) {\n return state.Blabla.items;\n }\n })),\n created: function created() {\n this.getArticle();\n },\n methods: _objectSpread(_objectSpread({}, (0, _vuex.mapActions)({\n getItems: 'Blabla/getItems',\n getItemIndex: 'Blabla/getItemIndex',\n getPrevNextItems: 'Blabla/getPrevNextItems'\n })), {}, {\n getArticle: function getArticle() {\n console.log(this.$route); // get the article uuid\n // if(this.$route.query.nid){\n // // we come from internal link with vuejs\n // // directly record uuid\n // this.nid = this.$route.query.nid\n //\n // }else if(drupalDecoupled.entity_type == 'node' && drupalDecoupled.entity_bundle == 'article'){\n // // we landed in an internal page\n // // get the uuid from drupalDeclouped, provided by materio_decoupled.module\n // this.nid = drupalDecoupled.entity_id\n // }\n\n if (this.$route.path) {\n // we come from internal link with vuejs\n this.path = this.$route.path;\n } else {\n // we landed in an internal page\n this.path = window.location.pathname;\n }\n\n if (this.path) {\n this.loadArticle();\n } else {\n // if for any reason we dont have the uuid\n // redirect to home\n this.$route.replace('home');\n }\n },\n getIndex: function getIndex() {\n var _this = this;\n\n console.log(\"Article getIndex article.id:\", this.article.id);\n this.getItemIndex(this.article.id).then(function (index) {\n _this.index = index;\n console.log('article index', index, _this);\n\n _this.getPrevNextItems(index).then(function (pn) {\n _this.prevnext = pn;\n });\n });\n },\n loadArticle: function loadArticle() {\n var _this2 = this;\n\n console.log('loadArticle');\n this.loading = true;\n var ast = (0, _graphqlTag.default)(_templateObject(), this.path, _articleFragment.default);\n\n _graphqlAxios.MGQ.post('', {\n query: (0, _printer.print)(ast)\n }).then(function (_ref) {\n var route = _ref.data.data.route;\n console.log('loadArticle', route);\n\n _this2.parseDataGQL(route);\n }).catch(function (error) {\n console.warn('Issue with loadArticle', error);\n Promise.reject(error);\n });\n },\n parseDataGQL: function parseDataGQL(article) {\n var _this3 = this;\n\n console.log('parseDataGQL article', article);\n this.article = article; // get the prev next items\n\n if (!this.items.length) {\n // if items list not yet loaded preload them\n this.getItems().then(function () {\n // then get the index\n _this3.getIndex();\n });\n } else {\n // or directly get the index\n this.getIndex();\n }\n\n this.image_accroche = article.images[0];\n this.lightbox_items = []; // fill the lightbox\n\n for (var i = 0; i < article.images.length; i++) {\n article.images[i].thumb = article.images[i].style_articlecardmedium.url;\n this.lightbox_items.push(article.images[i]);\n } // parse embeded videos pushing it in lightbox\n\n\n for (var i = 0; i < article.videos.length; i++) {\n var videoUrl = article.videos[i].url;\n\n var provider_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?(youtube|vimeo)\\.com\\/.+/, {\n provider: 2\n });\n\n var match = provider_regex.exec(videoUrl); // console.log('provider', match.groups.provider);\n\n var video_id = null;\n var video_thumb = null;\n\n switch (match.groups.provider) {\n case 'vimeo':\n var vimeo_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/vimeo\\.com\\/([0-9]+)/, {\n id: 1\n });\n\n video_id = vimeo_regex.exec(videoUrl).groups.id || null; // TODO: get the vimeo thumb https://coderwall.com/p/fdrdmg/get-a-thumbnail-from-a-vimeo-video\n\n video_thumb = \"http://blogpeda.ac-poitiers.fr/ent-lyc/files/2015/06/Vimeo_icon_block.png\";\n break;\n\n case 'youtube':\n var youtube_regex = /*#__PURE__*/_wrapRegExp(/https:\\/\\/(www\\.)?youtube\\.com\\/watch\\?v=(.+)/, {\n id: 2\n });\n\n video_id = youtube_regex.exec(videoUrl).groups.id || null;\n video_thumb = \"http://img.youtube.com/vi/\" + video_id + \"/0.jpg\";\n break;\n } // console.log('video_id', video_id);\n\n\n this.lightbox_items.push({\n url: videoUrl,\n title: \"\",\n description: \"\",\n thumb: video_thumb\n });\n }\n\n console.log('this.content.lightbox_items', this.lightbox_items); // update main page title\n\n this.$store.commit('Common/setPagetitle', article.title);\n this.loading = false;\n },\n onPrevNext: function onPrevNext(a) {\n // console.log('clicked on next', this.prevnext.next);\n // let alias = this.prevnext.next.view_node.replace(/^.?\\/blabla\\//g, '')\n var alias = a.replace(/^.?\\/blabla\\//g, '');\n this.$router.push({\n name: \"article\",\n params: {\n alias: alias\n } // query: { uuid: this.prevnext.next.uuid }\n\n });\n },\n // onNext(){\n // // console.log('clicked on next', this.prevnext.next);\n // let alias = this.prevnext.next.view_node.replace(/^.?\\/blabla\\//g, '')\n // this.$router.push({\n // name:`article`,\n // params: { alias:alias }\n // // query: { uuid: this.prevnext.next.uuid }\n // })\n // },\n // onPrev(){\n // // console.log('clicked on prev', this.prevnext.next);\n // let alias = this.prevnext.prev.view_node.replace(/^.?\\/blabla\\//g, '')\n // this.$router.push({\n // name:`article`,\n // params: { alias:alias }\n // // query: { uuid: this.prevnext.prev.uuid }\n // })\n // },\n setLightboxIndex: function setLightboxIndex(index) {\n this.lightbox_index = index;\n }\n }),\n components: {\n Card: _Card.default\n },\n watch: {\n '$route': function $route(to, from) {\n console.log('route change');\n this.getArticle();\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -1261,6 +1274,21 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ }), +/***/ "./node_modules/vue-meta/dist/vue-meta.esm.js": +/*!****************************************************!*\ + !*** ./node_modules/vue-meta/dist/vue-meta.esm.js ***! + \****************************************************/ +/*! namespace exports */ +/*! export default [provided] [no usage info] [missing usage info prevents renaming] */ +/*! other exports [not provided] [no usage info] */ +/*! runtime requirements: __webpack_require__, __webpack_require__.n, __webpack_exports__, __webpack_require__.r, __webpack_require__.g, __webpack_require__.d, __webpack_require__.* */ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => __WEBPACK_DEFAULT_EXPORT__\n/* harmony export */ });\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! deepmerge */ \"./node_modules/deepmerge/dist/cjs.js\");\n/* harmony import */ var deepmerge__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(deepmerge__WEBPACK_IMPORTED_MODULE_0__);\n/**\n * vue-meta v2.4.0\n * (c) 2020\n * - Declan de Wet\n * - Sébastien Chopin (@Atinux)\n * - Pim (@pimlie)\n * - All the amazing contributors\n * @license MIT\n */\n\nvar version = \"2.4.0\";\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly) symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(Object(source), true).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n }\n\n return target;\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && Symbol.iterator in Object(iter)) return Array.from(iter);\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) {\n var it;\n\n if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) {\n if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") {\n if (it) o = it;\n var i = 0;\n\n var F = function () {};\n\n return {\n s: F,\n n: function () {\n if (i >= o.length) return {\n done: true\n };\n return {\n done: false,\n value: o[i++]\n };\n },\n e: function (e) {\n throw e;\n },\n f: F\n };\n }\n\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n\n var normalCompletion = true,\n didErr = false,\n err;\n return {\n s: function () {\n it = o[Symbol.iterator]();\n },\n n: function () {\n var step = it.next();\n normalCompletion = step.done;\n return step;\n },\n e: function (e) {\n didErr = true;\n err = e;\n },\n f: function () {\n try {\n if (!normalCompletion && it.return != null) it.return();\n } finally {\n if (didErr) throw err;\n }\n }\n };\n}\n/**\n * checks if passed argument is an array\n * @param {any} arg - the object to check\n * @return {Boolean} - true if `arg` is an array\n */\n\n\nfunction isArray(arg) {\n return Array.isArray(arg);\n}\n\nfunction isUndefined(arg) {\n return typeof arg === 'undefined';\n}\n\nfunction isObject(arg) {\n return _typeof(arg) === 'object';\n}\n\nfunction isPureObject(arg) {\n return _typeof(arg) === 'object' && arg !== null;\n}\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\n\nfunction hasGlobalWindowFn() {\n try {\n return !isUndefined(window);\n } catch (e) {\n return false;\n }\n}\n\nvar hasGlobalWindow = hasGlobalWindowFn();\n\nvar _global = hasGlobalWindow ? window : __webpack_require__.g;\n\nvar console = _global.console || {};\n\nfunction warn(str) {\n /* istanbul ignore next */\n if (!console || !console.warn) {\n return;\n }\n\n console.warn(str);\n}\n\nvar showWarningNotSupported = function showWarningNotSupported() {\n return warn('This vue app/component has no vue-meta configuration');\n};\n/**\n * These are constant variables used throughout the application.\n */\n// set some sane defaults\n\n\nvar defaultInfo = {\n title: undefined,\n titleChunk: '',\n titleTemplate: '%s',\n htmlAttrs: {},\n bodyAttrs: {},\n headAttrs: {},\n base: [],\n link: [],\n meta: [],\n style: [],\n script: [],\n noscript: [],\n __dangerouslyDisableSanitizers: [],\n __dangerouslyDisableSanitizersByTagID: {}\n};\nvar rootConfigKey = '_vueMeta'; // This is the name of the component option that contains all the information that\n// gets converted to the various meta tags & attributes for the page.\n\nvar keyName = 'metaInfo'; // This is the attribute vue-meta arguments on elements to know which it should\n// manage and which it should ignore.\n\nvar attribute = 'data-vue-meta'; // This is the attribute that goes on the `html` tag to inform `vue-meta`\n// that the server has already generated the meta tags for the initial render.\n\nvar ssrAttribute = 'data-vue-meta-server-rendered'; // This is the property that tells vue-meta to overwrite (instead of append)\n// an item in a tag list. For example, if you have two `meta` tag list items\n// that both have `vmid` of \"description\", then vue-meta will overwrite the\n// shallowest one with the deepest one.\n\nvar tagIDKeyName = 'vmid'; // This is the key name for possible meta templates\n\nvar metaTemplateKeyName = 'template'; // This is the key name for the content-holding property\n\nvar contentKeyName = 'content'; // The id used for the ssr app\n\nvar ssrAppId = 'ssr'; // How long meta update\n\nvar debounceWait = 10; // How long meta update\n\nvar waitOnDestroyed = true;\nvar defaultOptions = {\n keyName: keyName,\n attribute: attribute,\n ssrAttribute: ssrAttribute,\n tagIDKeyName: tagIDKeyName,\n contentKeyName: contentKeyName,\n metaTemplateKeyName: metaTemplateKeyName,\n waitOnDestroyed: waitOnDestroyed,\n debounceWait: debounceWait,\n ssrAppId: ssrAppId\n}; // might be a bit ugly, but minimizes the browser bundles a bit\n\nvar defaultInfoKeys = Object.keys(defaultInfo); // The metaInfo property keys which are used to disable escaping\n\nvar disableOptionKeys = [defaultInfoKeys[12], defaultInfoKeys[13]]; // List of metaInfo property keys which are configuration options (and dont generate html)\n\nvar metaInfoOptionKeys = [defaultInfoKeys[1], defaultInfoKeys[2], 'changed'].concat(disableOptionKeys); // List of metaInfo property keys which only generates attributes and no tags\n\nvar metaInfoAttributeKeys = [defaultInfoKeys[3], defaultInfoKeys[4], defaultInfoKeys[5]]; // HTML elements which support the onload event\n\nvar tagsSupportingOnload = ['link', 'style', 'script']; // HTML elements which dont have a head tag (shortened to our needs)\n// see: https://www.w3.org/TR/html52/document-metadata.html\n\nvar tagsWithoutEndTag = ['base', 'meta', 'link']; // HTML elements which can have inner content (shortened to our needs)\n\nvar tagsWithInnerContent = ['noscript', 'script', 'style']; // Attributes which are inserted as childNodes instead of HTMLAttribute\n\nvar tagAttributeAsInnerContent = ['innerHTML', 'cssText', 'json'];\nvar tagProperties = ['once', 'skip', 'template']; // Attributes which should be added with data- prefix\n\nvar commonDataAttributes = ['body', 'pbody']; // from: https://github.com/kangax/html-minifier/blob/gh-pages/src/htmlminifier.js#L202\n\nvar booleanHtmlAttributes = ['allowfullscreen', 'amp', 'amp-boilerplate', 'async', 'autofocus', 'autoplay', 'checked', 'compact', 'controls', 'declare', 'default', 'defaultchecked', 'defaultmuted', 'defaultselected', 'defer', 'disabled', 'enabled', 'formnovalidate', 'hidden', 'indeterminate', 'inert', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nohref', 'noresize', 'noshade', 'novalidate', 'nowrap', 'open', 'pauseonexit', 'readonly', 'required', 'reversed', 'scoped', 'seamless', 'selected', 'sortable', 'truespeed', 'typemustmatch', 'visible'];\nvar batchId = null;\n\nfunction triggerUpdate(_ref, rootVm, hookName) {\n var debounceWait = _ref.debounceWait; // if an update was triggered during initialization or when an update was triggered by the\n // metaInfo watcher, set initialized to null\n // then we keep falsy value but know we need to run a triggerUpdate after initialization\n\n if (!rootVm[rootConfigKey].initialized && (rootVm[rootConfigKey].initializing || hookName === 'watcher')) {\n rootVm[rootConfigKey].initialized = null;\n }\n\n if (rootVm[rootConfigKey].initialized && !rootVm[rootConfigKey].pausing) {\n // batch potential DOM updates to prevent extraneous re-rendering\n // eslint-disable-next-line no-void\n batchUpdate(function () {\n return void rootVm.$meta().refresh();\n }, debounceWait);\n }\n}\n/**\n * Performs a batched update.\n *\n * @param {(null|Number)} id - the ID of this update\n * @param {Function} callback - the update to perform\n * @return {Number} id - a new ID\n */\n\n\nfunction batchUpdate(callback, timeout) {\n timeout = timeout === undefined ? 10 : timeout;\n\n if (!timeout) {\n callback();\n return;\n }\n\n clearTimeout(batchId);\n batchId = setTimeout(function () {\n callback();\n }, timeout);\n return batchId;\n}\n/*\n * To reduce build size, this file provides simple polyfills without\n * overly excessive type checking and without modifying\n * the global Array.prototype\n * The polyfills are automatically removed in the commonjs build\n * Also, only files in client/ & shared/ should use these functions\n * files in server/ still use normal js function\n */\n\n\nfunction find(array, predicate, thisArg) {\n if (!Array.prototype.find) {\n // idx needs to be a Number, for..in returns string\n for (var idx = 0; idx < array.length; idx++) {\n if (predicate.call(thisArg, array[idx], idx, array)) {\n return array[idx];\n }\n }\n\n return;\n }\n\n return array.find(predicate, thisArg);\n}\n\nfunction findIndex(array, predicate, thisArg) {\n if (!Array.prototype.findIndex) {\n // idx needs to be a Number, for..in returns string\n for (var idx = 0; idx < array.length; idx++) {\n if (predicate.call(thisArg, array[idx], idx, array)) {\n return idx;\n }\n }\n\n return -1;\n }\n\n return array.findIndex(predicate, thisArg);\n}\n\nfunction toArray(arg) {\n if (!Array.from) {\n return Array.prototype.slice.call(arg);\n }\n\n return Array.from(arg);\n}\n\nfunction includes(array, value) {\n if (!Array.prototype.includes) {\n for (var idx in array) {\n if (array[idx] === value) {\n return true;\n }\n }\n\n return false;\n }\n\n return array.includes(value);\n}\n\nvar querySelector = function querySelector(arg, el) {\n return (el || document).querySelectorAll(arg);\n};\n\nfunction getTag(tags, tag) {\n if (!tags[tag]) {\n tags[tag] = document.getElementsByTagName(tag)[0];\n }\n\n return tags[tag];\n}\n\nfunction getElementsKey(_ref) {\n var body = _ref.body,\n pbody = _ref.pbody;\n return body ? 'body' : pbody ? 'pbody' : 'head';\n}\n\nfunction queryElements(parentNode, _ref2, attributes) {\n var appId = _ref2.appId,\n attribute = _ref2.attribute,\n type = _ref2.type,\n tagIDKeyName = _ref2.tagIDKeyName;\n attributes = attributes || {};\n var queries = [\"\".concat(type, \"[\").concat(attribute, \"=\\\"\").concat(appId, \"\\\"]\"), \"\".concat(type, \"[data-\").concat(tagIDKeyName, \"]\")].map(function (query) {\n for (var key in attributes) {\n var val = attributes[key];\n var attributeValue = val && val !== true ? \"=\\\"\".concat(val, \"\\\"\") : '';\n query += \"[data-\".concat(key).concat(attributeValue, \"]\");\n }\n\n return query;\n });\n return toArray(querySelector(queries.join(', '), parentNode));\n}\n\nfunction removeElementsByAppId(_ref3, appId) {\n var attribute = _ref3.attribute;\n toArray(querySelector(\"[\".concat(attribute, \"=\\\"\").concat(appId, \"\\\"]\"))).map(function (el) {\n return el.remove();\n });\n}\n\nfunction removeAttribute(el, attributeName) {\n el.removeAttribute(attributeName);\n}\n\nfunction hasMetaInfo(vm) {\n vm = vm || this;\n return vm && (vm[rootConfigKey] === true || isObject(vm[rootConfigKey]));\n} // a component is in a metaInfo branch when itself has meta info or one of its (grand-)children has\n\n\nfunction inMetaInfoBranch(vm) {\n vm = vm || this;\n return vm && !isUndefined(vm[rootConfigKey]);\n}\n\nfunction pause(rootVm, refresh) {\n rootVm[rootConfigKey].pausing = true;\n return function () {\n return resume(rootVm, refresh);\n };\n}\n\nfunction resume(rootVm, refresh) {\n rootVm[rootConfigKey].pausing = false;\n\n if (refresh || refresh === undefined) {\n return rootVm.$meta().refresh();\n }\n}\n\nfunction addNavGuards(rootVm) {\n var router = rootVm.$router; // return when nav guards already added or no router exists\n\n if (rootVm[rootConfigKey].navGuards || !router) {\n /* istanbul ignore next */\n return;\n }\n\n rootVm[rootConfigKey].navGuards = true;\n router.beforeEach(function (to, from, next) {\n pause(rootVm);\n next();\n });\n router.afterEach(function () {\n rootVm.$nextTick(function () {\n var _resume = resume(rootVm),\n metaInfo = _resume.metaInfo;\n\n if (metaInfo && isFunction(metaInfo.afterNavigation)) {\n metaInfo.afterNavigation(metaInfo);\n }\n });\n });\n}\n\nvar appId = 1;\n\nfunction createMixin(Vue, options) {\n // for which Vue lifecycle hooks should the metaInfo be refreshed\n var updateOnLifecycleHook = ['activated', 'deactivated', 'beforeMount'];\n var wasServerRendered = false; // watch for client side component updates\n\n return {\n beforeCreate: function beforeCreate() {\n var _this2 = this;\n\n var rootKey = '$root';\n var $root = this[rootKey];\n var $options = this.$options;\n var devtoolsEnabled = Vue.config.devtools;\n Object.defineProperty(this, '_hasMetaInfo', {\n configurable: true,\n get: function get() {\n // Show deprecation warning once when devtools enabled\n if (devtoolsEnabled && !$root[rootConfigKey].deprecationWarningShown) {\n warn('VueMeta DeprecationWarning: _hasMetaInfo has been deprecated and will be removed in a future version. Please use hasMetaInfo(vm) instead');\n $root[rootConfigKey].deprecationWarningShown = true;\n }\n\n return hasMetaInfo(this);\n }\n });\n\n if (this === $root) {\n $root.$once('hook:beforeMount', function () {\n wasServerRendered = this.$el && this.$el.nodeType === 1 && this.$el.hasAttribute('data-server-rendered'); // In most cases when you have a SSR app it will be the first app thats gonna be\n // initiated, if we cant detect the data-server-rendered attribute from Vue but we\n // do see our own ssrAttribute then _assume_ the Vue app with appId 1 is the ssr app\n // attempted fix for #404 & #562, but we rly need to refactor how we pass appIds from\n // ssr to the client\n\n if (!wasServerRendered && $root[rootConfigKey] && $root[rootConfigKey].appId === 1) {\n var htmlTag = getTag({}, 'html');\n wasServerRendered = htmlTag && htmlTag.hasAttribute(options.ssrAttribute);\n }\n });\n } // Add a marker to know if it uses metaInfo\n // _vnode is used to know that it's attached to a real component\n // useful if we use some mixin to add some meta tags (like nuxt-i18n)\n\n\n if (isUndefined($options[options.keyName]) || $options[options.keyName] === null) {\n return;\n }\n\n if (!$root[rootConfigKey]) {\n $root[rootConfigKey] = {\n appId: appId\n };\n appId++;\n\n if (devtoolsEnabled && $root.$options[options.keyName]) {\n // use nextTick so the children should be added to $root\n this.$nextTick(function () {\n // find the first child that lists fnOptions\n var child = find($root.$children, function (c) {\n return c.$vnode && c.$vnode.fnOptions;\n });\n\n if (child && child.$vnode.fnOptions[options.keyName]) {\n warn(\"VueMeta has detected a possible global mixin which adds a \".concat(options.keyName, \" property to all Vue components on the page. This could cause severe performance issues. If possible, use $meta().addApp to add meta information instead\"));\n }\n });\n }\n } // to speed up updates we keep track of branches which have a component with vue-meta info defined\n // if _vueMeta = true it has info, if _vueMeta = false a child has info\n\n\n if (!this[rootConfigKey]) {\n this[rootConfigKey] = true;\n var parent = this.$parent;\n\n while (parent && parent !== $root) {\n if (isUndefined(parent[rootConfigKey])) {\n parent[rootConfigKey] = false;\n }\n\n parent = parent.$parent;\n }\n } // coerce function-style metaInfo to a computed prop so we can observe\n // it on creation\n\n\n if (isFunction($options[options.keyName])) {\n $options.computed = $options.computed || {};\n $options.computed.$metaInfo = $options[options.keyName];\n\n if (!this.$isServer) {\n // if computed $metaInfo exists, watch it for updates & trigger a refresh\n // when it changes (i.e. automatically handle async actions that affect metaInfo)\n // credit for this suggestion goes to [Sébastien Chopin](https://github.com/Atinux)\n this.$on('hook:created', function () {\n this.$watch('$metaInfo', function () {\n triggerUpdate(options, this[rootKey], 'watcher');\n });\n });\n }\n } // force an initial refresh on page load and prevent other lifecycleHooks\n // to triggerUpdate until this initial refresh is finished\n // this is to make sure that when a page is opened in an inactive tab which\n // has throttled rAF/timers we still immediately set the page title\n\n\n if (isUndefined($root[rootConfigKey].initialized)) {\n $root[rootConfigKey].initialized = this.$isServer;\n\n if (!$root[rootConfigKey].initialized) {\n if (!$root[rootConfigKey].initializedSsr) {\n $root[rootConfigKey].initializedSsr = true;\n this.$on('hook:beforeMount', function () {\n var $root = this[rootKey]; // if this Vue-app was server rendered, set the appId to 'ssr'\n // only one SSR app per page is supported\n\n if (wasServerRendered) {\n $root[rootConfigKey].appId = options.ssrAppId;\n }\n });\n } // we use the mounted hook here as on page load\n\n\n this.$on('hook:mounted', function () {\n var $root = this[rootKey];\n\n if ($root[rootConfigKey].initialized) {\n return;\n } // used in triggerUpdate to check if a change was triggered\n // during initialization\n\n\n $root[rootConfigKey].initializing = true; // refresh meta in nextTick so all child components have loaded\n\n this.$nextTick(function () {\n var _$root$$meta$refresh = $root.$meta().refresh(),\n tags = _$root$$meta$refresh.tags,\n metaInfo = _$root$$meta$refresh.metaInfo; // After ssr hydration (identifier by tags === false) check\n // if initialized was set to null in triggerUpdate. That'd mean\n // that during initilazation changes where triggered which need\n // to be applied OR a metaInfo watcher was triggered before the\n // current hook was called\n // (during initialization all changes are blocked)\n\n\n if (tags === false && $root[rootConfigKey].initialized === null) {\n this.$nextTick(function () {\n return triggerUpdate(options, $root, 'init');\n });\n }\n\n $root[rootConfigKey].initialized = true;\n delete $root[rootConfigKey].initializing; // add the navigation guards if they havent been added yet\n // they are needed for the afterNavigation callback\n\n if (!options.refreshOnceOnNavigation && metaInfo.afterNavigation) {\n addNavGuards($root);\n }\n });\n }); // add the navigation guards if requested\n\n if (options.refreshOnceOnNavigation) {\n addNavGuards($root);\n }\n }\n }\n\n this.$on('hook:destroyed', function () {\n var _this = this; // do not trigger refresh:\n // - when user configured to not wait for transitions on destroyed\n // - when the component doesnt have a parent\n // - doesnt have metaInfo defined\n\n\n if (!this.$parent || !hasMetaInfo(this)) {\n return;\n }\n\n delete this._hasMetaInfo;\n this.$nextTick(function () {\n if (!options.waitOnDestroyed || !_this.$el || !_this.$el.offsetParent) {\n triggerUpdate(options, _this.$root, 'destroyed');\n return;\n } // Wait that element is hidden before refreshing meta tags (to support animations)\n\n\n var interval = setInterval(function () {\n if (_this.$el && _this.$el.offsetParent !== null) {\n /* istanbul ignore next line */\n return;\n }\n\n clearInterval(interval);\n triggerUpdate(options, _this.$root, 'destroyed');\n }, 50);\n });\n }); // do not trigger refresh on the server side\n\n if (this.$isServer) {\n /* istanbul ignore next */\n return;\n } // no need to add this hooks on server side\n\n\n updateOnLifecycleHook.forEach(function (lifecycleHook) {\n _this2.$on(\"hook:\".concat(lifecycleHook), function () {\n triggerUpdate(options, this[rootKey], lifecycleHook);\n });\n });\n }\n };\n}\n\nfunction setOptions(options) {\n // combine options\n options = isObject(options) ? options : {}; // The options are set like this so they can\n // be minified by terser while keeping the\n // user api intact\n // terser --mangle-properties keep_quoted=strict\n\n /* eslint-disable dot-notation */\n\n return {\n keyName: options['keyName'] || defaultOptions.keyName,\n attribute: options['attribute'] || defaultOptions.attribute,\n ssrAttribute: options['ssrAttribute'] || defaultOptions.ssrAttribute,\n tagIDKeyName: options['tagIDKeyName'] || defaultOptions.tagIDKeyName,\n contentKeyName: options['contentKeyName'] || defaultOptions.contentKeyName,\n metaTemplateKeyName: options['metaTemplateKeyName'] || defaultOptions.metaTemplateKeyName,\n debounceWait: isUndefined(options['debounceWait']) ? defaultOptions.debounceWait : options['debounceWait'],\n waitOnDestroyed: isUndefined(options['waitOnDestroyed']) ? defaultOptions.waitOnDestroyed : options['waitOnDestroyed'],\n ssrAppId: options['ssrAppId'] || defaultOptions.ssrAppId,\n refreshOnceOnNavigation: !!options['refreshOnceOnNavigation']\n };\n /* eslint-enable dot-notation */\n}\n\nfunction getOptions(options) {\n var optionsCopy = {};\n\n for (var key in options) {\n optionsCopy[key] = options[key];\n }\n\n return optionsCopy;\n}\n\nfunction ensureIsArray(arg, key) {\n if (!key || !isObject(arg)) {\n return isArray(arg) ? arg : [];\n }\n\n if (!isArray(arg[key])) {\n arg[key] = [];\n }\n\n return arg;\n}\n\nvar serverSequences = [[/&/g, '&'], [//g, '>'], [/\"/g, '"'], [/'/g, ''']];\nvar clientSequences = [[/&/g, \"&\"], [//g, \">\"], [/\"/g, \"\\\"\"], [/'/g, \"'\"]]; // sanitizes potentially dangerous characters\n\nfunction escape(info, options, escapeOptions, escapeKeys) {\n var tagIDKeyName = options.tagIDKeyName;\n var _escapeOptions$doEsca = escapeOptions.doEscape,\n doEscape = _escapeOptions$doEsca === void 0 ? function (v) {\n return v;\n } : _escapeOptions$doEsca;\n var escaped = {};\n\n for (var key in info) {\n var value = info[key]; // no need to escape configuration options\n\n if (includes(metaInfoOptionKeys, key)) {\n escaped[key] = value;\n continue;\n } // do not use destructuring for disableOptionKeys, it increases transpiled size\n // due to var checks while we are guaranteed the structure of the cb\n\n\n var disableKey = disableOptionKeys[0];\n\n if (escapeOptions[disableKey] && includes(escapeOptions[disableKey], key)) {\n // this info[key] doesnt need to escaped if the option is listed in __dangerouslyDisableSanitizers\n escaped[key] = value;\n continue;\n }\n\n var tagId = info[tagIDKeyName];\n\n if (tagId) {\n disableKey = disableOptionKeys[1]; // keys which are listed in __dangerouslyDisableSanitizersByTagID for the current vmid do not need to be escaped\n\n if (escapeOptions[disableKey] && escapeOptions[disableKey][tagId] && includes(escapeOptions[disableKey][tagId], key)) {\n escaped[key] = value;\n continue;\n }\n }\n\n if (isString(value)) {\n escaped[key] = doEscape(value);\n } else if (isArray(value)) {\n escaped[key] = value.map(function (v) {\n if (isPureObject(v)) {\n return escape(v, options, escapeOptions, true);\n }\n\n return doEscape(v);\n });\n } else if (isPureObject(value)) {\n escaped[key] = escape(value, options, escapeOptions, true);\n } else {\n escaped[key] = value;\n }\n\n if (escapeKeys) {\n var escapedKey = doEscape(key);\n\n if (key !== escapedKey) {\n escaped[escapedKey] = escaped[key];\n delete escaped[key];\n }\n }\n }\n\n return escaped;\n}\n\nfunction escapeMetaInfo(options, info, escapeSequences) {\n escapeSequences = escapeSequences || []; // do not use destructuring for seq, it increases transpiled size\n // due to var checks while we are guaranteed the structure of the cb\n\n var escapeOptions = {\n doEscape: function doEscape(value) {\n return escapeSequences.reduce(function (val, seq) {\n return val.replace(seq[0], seq[1]);\n }, value);\n }\n };\n disableOptionKeys.forEach(function (disableKey, index) {\n if (index === 0) {\n ensureIsArray(info, disableKey);\n } else if (index === 1) {\n for (var key in info[disableKey]) {\n ensureIsArray(info[disableKey], key);\n }\n }\n\n escapeOptions[disableKey] = info[disableKey];\n }); // begin sanitization\n\n return escape(info, options, escapeOptions);\n}\n\nfunction applyTemplate(_ref, headObject, template, chunk) {\n var component = _ref.component,\n metaTemplateKeyName = _ref.metaTemplateKeyName,\n contentKeyName = _ref.contentKeyName;\n\n if (template === true || headObject[metaTemplateKeyName] === true) {\n // abort, template was already applied\n return false;\n }\n\n if (isUndefined(template) && headObject[metaTemplateKeyName]) {\n template = headObject[metaTemplateKeyName];\n headObject[metaTemplateKeyName] = true;\n } // return early if no template defined\n\n\n if (!template) {\n // cleanup faulty template properties\n delete headObject[metaTemplateKeyName];\n return false;\n }\n\n if (isUndefined(chunk)) {\n chunk = headObject[contentKeyName];\n }\n\n headObject[contentKeyName] = isFunction(template) ? template.call(component, chunk) : template.replace(/%s/g, chunk);\n return true;\n}\n\nfunction _arrayMerge(_ref, target, source) {\n var component = _ref.component,\n tagIDKeyName = _ref.tagIDKeyName,\n metaTemplateKeyName = _ref.metaTemplateKeyName,\n contentKeyName = _ref.contentKeyName; // we concat the arrays without merging objects contained in,\n // but we check for a `vmid` property on each object in the array\n // using an O(1) lookup associative array exploit\n\n var destination = [];\n\n if (!target.length && !source.length) {\n return destination;\n }\n\n target.forEach(function (targetItem, targetIndex) {\n // no tagID so no need to check for duplicity\n if (!targetItem[tagIDKeyName]) {\n destination.push(targetItem);\n return;\n }\n\n var sourceIndex = findIndex(source, function (item) {\n return item[tagIDKeyName] === targetItem[tagIDKeyName];\n });\n var sourceItem = source[sourceIndex]; // source doesnt contain any duplicate vmid's, we can keep targetItem\n\n if (sourceIndex === -1) {\n destination.push(targetItem);\n return;\n } // when sourceItem explictly defines contentKeyName or innerHTML as undefined, its\n // an indication that we need to skip the default behaviour or child has preference over parent\n // which means we keep the targetItem and ignore/remove the sourceItem\n\n\n if (contentKeyName in sourceItem && sourceItem[contentKeyName] === undefined || 'innerHTML' in sourceItem && sourceItem.innerHTML === undefined) {\n destination.push(targetItem); // remove current index from source array so its not concatenated to destination below\n\n source.splice(sourceIndex, 1);\n return;\n } // we now know that targetItem is a duplicate and we should ignore it in favor of sourceItem\n // if source specifies null as content then ignore both the target as the source\n\n\n if (sourceItem[contentKeyName] === null || sourceItem.innerHTML === null) {\n // remove current index from source array so its not concatenated to destination below\n source.splice(sourceIndex, 1);\n return;\n } // now we only need to check if the target has a template to combine it with the source\n\n\n var targetTemplate = targetItem[metaTemplateKeyName];\n\n if (!targetTemplate) {\n return;\n }\n\n var sourceTemplate = sourceItem[metaTemplateKeyName];\n\n if (!sourceTemplate) {\n // use parent template and child content\n applyTemplate({\n component: component,\n metaTemplateKeyName: metaTemplateKeyName,\n contentKeyName: contentKeyName\n }, sourceItem, targetTemplate); // set template to true to indicate template was already applied\n\n sourceItem.template = true;\n return;\n }\n\n if (!sourceItem[contentKeyName]) {\n // use parent content and child template\n applyTemplate({\n component: component,\n metaTemplateKeyName: metaTemplateKeyName,\n contentKeyName: contentKeyName\n }, sourceItem, undefined, targetItem[contentKeyName]);\n }\n });\n return destination.concat(source);\n}\n\nvar warningShown = false;\n\nfunction merge(target, source, options) {\n options = options || {}; // remove properties explicitly set to false so child components can\n // optionally _not_ overwrite the parents content\n // (for array properties this is checked in arrayMerge)\n\n if (source.title === undefined) {\n delete source.title;\n }\n\n metaInfoAttributeKeys.forEach(function (attrKey) {\n if (!source[attrKey]) {\n return;\n }\n\n for (var key in source[attrKey]) {\n if (key in source[attrKey] && source[attrKey][key] === undefined) {\n if (includes(booleanHtmlAttributes, key) && !warningShown) {\n warn('VueMeta: Please note that since v2 the value undefined is not used to indicate boolean attributes anymore, see migration guide for details');\n warningShown = true;\n }\n\n delete source[attrKey][key];\n }\n }\n });\n return deepmerge__WEBPACK_IMPORTED_MODULE_0___default()(target, source, {\n arrayMerge: function arrayMerge(t, s) {\n return _arrayMerge(options, t, s);\n }\n });\n}\n\nfunction getComponentMetaInfo(options, component) {\n return getComponentOption(options || {}, component, defaultInfo);\n}\n/**\n * Returns the `opts.option` $option value of the given `opts.component`.\n * If methods are encountered, they will be bound to the component context.\n * If `opts.deep` is true, will recursively merge all child component\n * `opts.option` $option values into the returned result.\n *\n * @param {Object} opts - options\n * @param {Object} opts.component - Vue component to fetch option data from\n * @param {Boolean} opts.deep - look for data in child components as well?\n * @param {Function} opts.arrayMerge - how should arrays be merged?\n * @param {String} opts.keyName - the name of the option to look for\n * @param {Object} [result={}] - result so far\n * @return {Object} result - final aggregated result\n */\n\n\nfunction getComponentOption(options, component, result) {\n result = result || {};\n\n if (component._inactive) {\n return result;\n }\n\n options = options || {};\n var _options = options,\n keyName = _options.keyName;\n var $metaInfo = component.$metaInfo,\n $options = component.$options,\n $children = component.$children; // only collect option data if it exists\n\n if ($options[keyName]) {\n // if $metaInfo exists then [keyName] was defined as a function\n // and set to the computed prop $metaInfo in the mixin\n // using the computed prop should be a small performance increase\n // because Vue caches those internally\n var data = $metaInfo || $options[keyName]; // only merge data with result when its an object\n // eg it could be a function when metaInfo() returns undefined\n // dueo to the or statement above\n\n if (isObject(data)) {\n result = merge(result, data, options);\n }\n } // collect & aggregate child options if deep = true\n\n\n if ($children.length) {\n $children.forEach(function (childComponent) {\n // check if the childComponent is in a branch\n // return otherwise so we dont walk all component branches unnecessarily\n if (!inMetaInfoBranch(childComponent)) {\n return;\n }\n\n result = getComponentOption(options, childComponent, result);\n });\n }\n\n return result;\n}\n\nvar callbacks = [];\n\nfunction isDOMComplete(d) {\n return (d || document).readyState === 'complete';\n}\n\nfunction addCallback(query, callback) {\n if (arguments.length === 1) {\n callback = query;\n query = '';\n }\n\n callbacks.push([query, callback]);\n}\n\nfunction addCallbacks(_ref, type, tags, autoAddListeners) {\n var tagIDKeyName = _ref.tagIDKeyName;\n var hasAsyncCallback = false;\n tags.forEach(function (tag) {\n if (!tag[tagIDKeyName] || !tag.callback) {\n return;\n }\n\n hasAsyncCallback = true;\n addCallback(\"\".concat(type, \"[data-\").concat(tagIDKeyName, \"=\\\"\").concat(tag[tagIDKeyName], \"\\\"]\"), tag.callback);\n });\n\n if (!autoAddListeners || !hasAsyncCallback) {\n return hasAsyncCallback;\n }\n\n return addListeners();\n}\n\nfunction addListeners() {\n if (isDOMComplete()) {\n applyCallbacks();\n return;\n } // Instead of using a MutationObserver, we just apply\n\n /* istanbul ignore next */\n\n\n document.onreadystatechange = function () {\n applyCallbacks();\n };\n}\n\nfunction applyCallbacks(matchElement) {\n callbacks.forEach(function (args) {\n // do not use destructuring for args, it increases transpiled size\n // due to var checks while we are guaranteed the structure of the cb\n var query = args[0];\n var callback = args[1];\n var selector = \"\".concat(query, \"[onload=\\\"this.__vm_l=1\\\"]\");\n var elements = [];\n\n if (!matchElement) {\n elements = toArray(querySelector(selector));\n }\n\n if (matchElement && matchElement.matches(selector)) {\n elements = [matchElement];\n }\n\n elements.forEach(function (element) {\n /* __vm_cb: whether the load callback has been called\n * __vm_l: set by onload attribute, whether the element was loaded\n * __vm_ev: whether the event listener was added or not\n */\n if (element.__vm_cb) {\n return;\n }\n\n var onload = function onload() {\n /* Mark that the callback for this element has already been called,\n * this prevents the callback to run twice in some (rare) conditions\n */\n element.__vm_cb = true;\n /* onload needs to be removed because we only need the\n * attribute after ssr and if we dont remove it the node\n * will fail isEqualNode on the client\n */\n\n removeAttribute(element, 'onload');\n callback(element);\n };\n /* IE9 doesnt seem to load scripts synchronously,\n * causing a script sometimes/often already to be loaded\n * when we add the event listener below (thus adding an onload event\n * listener has no use because it will never be triggered).\n * Therefore we add the onload attribute during ssr, and\n * check here if it was already loaded or not\n */\n\n\n if (element.__vm_l) {\n onload();\n return;\n }\n\n if (!element.__vm_ev) {\n element.__vm_ev = true;\n element.addEventListener('load', onload);\n }\n });\n });\n} // instead of adding it to the html\n\n\nvar attributeMap = {};\n/**\n * Updates the document's html tag attributes\n *\n * @param {Object} attrs - the new document html attributes\n * @param {HTMLElement} tag - the HTMLElement tag to update with new attrs\n */\n\nfunction updateAttribute(appId, options, type, attrs, tag) {\n var _ref = options || {},\n attribute = _ref.attribute;\n\n var vueMetaAttrString = tag.getAttribute(attribute);\n\n if (vueMetaAttrString) {\n attributeMap[type] = JSON.parse(decodeURI(vueMetaAttrString));\n removeAttribute(tag, attribute);\n }\n\n var data = attributeMap[type] || {};\n var toUpdate = []; // remove attributes from the map\n // which have been removed for this appId\n\n for (var attr in data) {\n if (data[attr] !== undefined && appId in data[attr]) {\n toUpdate.push(attr);\n\n if (!attrs[attr]) {\n delete data[attr][appId];\n }\n }\n }\n\n for (var _attr in attrs) {\n var attrData = data[_attr];\n\n if (!attrData || attrData[appId] !== attrs[_attr]) {\n toUpdate.push(_attr);\n\n if (attrs[_attr] !== undefined) {\n data[_attr] = data[_attr] || {};\n data[_attr][appId] = attrs[_attr];\n }\n }\n }\n\n for (var _i = 0, _toUpdate = toUpdate; _i < _toUpdate.length; _i++) {\n var _attr2 = _toUpdate[_i];\n var _attrData = data[_attr2];\n var attrValues = [];\n\n for (var _appId in _attrData) {\n Array.prototype.push.apply(attrValues, [].concat(_attrData[_appId]));\n }\n\n if (attrValues.length) {\n var attrValue = includes(booleanHtmlAttributes, _attr2) && attrValues.some(Boolean) ? '' : attrValues.filter(function (v) {\n return v !== undefined;\n }).join(' ');\n tag.setAttribute(_attr2, attrValue);\n } else {\n removeAttribute(tag, _attr2);\n }\n }\n\n attributeMap[type] = data;\n}\n/**\n * Updates the document title\n *\n * @param {String} title - the new title of the document\n */\n\n\nfunction updateTitle(title) {\n if (!title && title !== '') {\n return;\n }\n\n document.title = title;\n}\n/**\n * Updates meta tags inside and on the client. Borrowed from `react-helmet`:\n * https://github.com/nfl/react-helmet/blob/004d448f8de5f823d10f838b02317521180f34da/src/Helmet.js#L195-L245\n *\n * @param {('meta'|'base'|'link'|'style'|'script'|'noscript')} type - the name of the tag\n * @param {(Array|Object)} tags - an array of tag objects or a single object in case of base\n * @return {Object} - a representation of what tags changed\n */\n\n\nfunction updateTag(appId, options, type, tags, head, body) {\n var _ref = options || {},\n attribute = _ref.attribute,\n tagIDKeyName = _ref.tagIDKeyName;\n\n var dataAttributes = commonDataAttributes.slice();\n dataAttributes.push(tagIDKeyName);\n var newElements = [];\n var queryOptions = {\n appId: appId,\n attribute: attribute,\n type: type,\n tagIDKeyName: tagIDKeyName\n };\n var currentElements = {\n head: queryElements(head, queryOptions),\n pbody: queryElements(body, queryOptions, {\n pbody: true\n }),\n body: queryElements(body, queryOptions, {\n body: true\n })\n };\n\n if (tags.length > 1) {\n // remove duplicates that could have been found by merging tags\n // which include a mixin with metaInfo and that mixin is used\n // by multiple components on the same page\n var found = [];\n tags = tags.filter(function (x) {\n var k = JSON.stringify(x);\n var res = !includes(found, k);\n found.push(k);\n return res;\n });\n }\n\n tags.forEach(function (tag) {\n if (tag.skip) {\n return;\n }\n\n var newElement = document.createElement(type);\n\n if (!tag.once) {\n newElement.setAttribute(attribute, appId);\n }\n\n Object.keys(tag).forEach(function (attr) {\n /* istanbul ignore next */\n if (includes(tagProperties, attr)) {\n return;\n }\n\n if (attr === 'innerHTML') {\n newElement.innerHTML = tag.innerHTML;\n return;\n }\n\n if (attr === 'json') {\n newElement.innerHTML = JSON.stringify(tag.json);\n return;\n }\n\n if (attr === 'cssText') {\n if (newElement.styleSheet) {\n /* istanbul ignore next */\n newElement.styleSheet.cssText = tag.cssText;\n } else {\n newElement.appendChild(document.createTextNode(tag.cssText));\n }\n\n return;\n }\n\n if (attr === 'callback') {\n newElement.onload = function () {\n return tag[attr](newElement);\n };\n\n return;\n }\n\n var _attr = includes(dataAttributes, attr) ? \"data-\".concat(attr) : attr;\n\n var isBooleanAttribute = includes(booleanHtmlAttributes, attr);\n\n if (isBooleanAttribute && !tag[attr]) {\n return;\n }\n\n var value = isBooleanAttribute ? '' : tag[attr];\n newElement.setAttribute(_attr, value);\n });\n var oldElements = currentElements[getElementsKey(tag)]; // Remove a duplicate tag from domTagstoRemove, so it isn't cleared.\n\n var indexToDelete;\n var hasEqualElement = oldElements.some(function (existingTag, index) {\n indexToDelete = index;\n return newElement.isEqualNode(existingTag);\n });\n\n if (hasEqualElement && (indexToDelete || indexToDelete === 0)) {\n oldElements.splice(indexToDelete, 1);\n } else {\n newElements.push(newElement);\n }\n });\n var oldElements = [];\n\n for (var _type in currentElements) {\n Array.prototype.push.apply(oldElements, currentElements[_type]);\n } // remove old elements\n\n\n oldElements.forEach(function (element) {\n element.parentNode.removeChild(element);\n }); // insert new elements\n\n newElements.forEach(function (element) {\n if (element.hasAttribute('data-body')) {\n body.appendChild(element);\n return;\n }\n\n if (element.hasAttribute('data-pbody')) {\n body.insertBefore(element, body.firstChild);\n return;\n }\n\n head.appendChild(element);\n });\n return {\n oldTags: oldElements,\n newTags: newElements\n };\n}\n/**\n * Performs client-side updates when new meta info is received\n *\n * @param {Object} newInfo - the meta info to update to\n */\n\n\nfunction updateClientMetaInfo(appId, options, newInfo) {\n options = options || {};\n var _options = options,\n ssrAttribute = _options.ssrAttribute,\n ssrAppId = _options.ssrAppId; // only cache tags for current update\n\n var tags = {};\n var htmlTag = getTag(tags, 'html'); // if this is a server render, then dont update\n\n if (appId === ssrAppId && htmlTag.hasAttribute(ssrAttribute)) {\n // remove the server render attribute so we can update on (next) changes\n removeAttribute(htmlTag, ssrAttribute); // add load callbacks if the\n\n var addLoadListeners = false;\n tagsSupportingOnload.forEach(function (type) {\n if (newInfo[type] && addCallbacks(options, type, newInfo[type])) {\n addLoadListeners = true;\n }\n });\n\n if (addLoadListeners) {\n addListeners();\n }\n\n return false;\n } // initialize tracked changes\n\n\n var tagsAdded = {};\n var tagsRemoved = {};\n\n for (var type in newInfo) {\n // ignore these\n if (includes(metaInfoOptionKeys, type)) {\n continue;\n }\n\n if (type === 'title') {\n // update the title\n updateTitle(newInfo.title);\n continue;\n }\n\n if (includes(metaInfoAttributeKeys, type)) {\n var tagName = type.substr(0, 4);\n updateAttribute(appId, options, type, newInfo[type], getTag(tags, tagName));\n continue;\n } // tags should always be an array, ignore if it isnt\n\n\n if (!isArray(newInfo[type])) {\n continue;\n }\n\n var _updateTag = updateTag(appId, options, type, newInfo[type], getTag(tags, 'head'), getTag(tags, 'body')),\n oldTags = _updateTag.oldTags,\n newTags = _updateTag.newTags;\n\n if (newTags.length) {\n tagsAdded[type] = newTags;\n tagsRemoved[type] = oldTags;\n }\n }\n\n return {\n tagsAdded: tagsAdded,\n tagsRemoved: tagsRemoved\n };\n}\n\nvar appsMetaInfo;\n\nfunction addApp(rootVm, appId, options) {\n return {\n set: function set(metaInfo) {\n return setMetaInfo(rootVm, appId, options, metaInfo);\n },\n remove: function remove() {\n return removeMetaInfo(rootVm, appId, options);\n }\n };\n}\n\nfunction setMetaInfo(rootVm, appId, options, metaInfo) {\n // if a vm exists _and_ its mounted then immediately update\n if (rootVm && rootVm.$el) {\n return updateClientMetaInfo(appId, options, metaInfo);\n } // store for later, the info\n // will be set on the first refresh\n\n\n appsMetaInfo = appsMetaInfo || {};\n appsMetaInfo[appId] = metaInfo;\n}\n\nfunction removeMetaInfo(rootVm, appId, options) {\n if (rootVm && rootVm.$el) {\n var tags = {};\n\n var _iterator = _createForOfIteratorHelper(metaInfoAttributeKeys),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var type = _step.value;\n var tagName = type.substr(0, 4);\n updateAttribute(appId, options, type, {}, getTag(tags, tagName));\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n return removeElementsByAppId(options, appId);\n }\n\n if (appsMetaInfo[appId]) {\n delete appsMetaInfo[appId];\n clearAppsMetaInfo();\n }\n}\n\nfunction getAppsMetaInfo() {\n return appsMetaInfo;\n}\n\nfunction clearAppsMetaInfo(force) {\n if (force || !Object.keys(appsMetaInfo).length) {\n appsMetaInfo = undefined;\n }\n}\n/**\n * Returns the correct meta info for the given component\n * (child components will overwrite parent meta info)\n *\n * @param {Object} component - the Vue instance to get meta info from\n * @return {Object} - returned meta info\n */\n\n\nfunction getMetaInfo(options, info, escapeSequences, component) {\n options = options || {};\n escapeSequences = escapeSequences || [];\n var _options = options,\n tagIDKeyName = _options.tagIDKeyName; // Remove all \"template\" tags from meta\n // backup the title chunk in case user wants access to it\n\n if (info.title) {\n info.titleChunk = info.title;\n } // replace title with populated template\n\n\n if (info.titleTemplate && info.titleTemplate !== '%s') {\n applyTemplate({\n component: component,\n contentKeyName: 'title'\n }, info, info.titleTemplate, info.titleChunk || '');\n } // convert base tag to an array so it can be handled the same way\n // as the other tags\n\n\n if (info.base) {\n info.base = Object.keys(info.base).length ? [info.base] : [];\n }\n\n if (info.meta) {\n // remove meta items with duplicate vmid's\n info.meta = info.meta.filter(function (metaItem, index, arr) {\n var hasVmid = !!metaItem[tagIDKeyName];\n\n if (!hasVmid) {\n return true;\n }\n\n var isFirstItemForVmid = index === findIndex(arr, function (item) {\n return item[tagIDKeyName] === metaItem[tagIDKeyName];\n });\n return isFirstItemForVmid;\n }); // apply templates if needed\n\n info.meta.forEach(function (metaObject) {\n return applyTemplate(options, metaObject);\n });\n }\n\n return escapeMetaInfo(options, info, escapeSequences);\n}\n/**\n * When called, will update the current meta info with new meta info.\n * Useful when updating meta info as the result of an asynchronous\n * action that resolves after the initial render takes place.\n *\n * Credit to [Sébastien Chopin](https://github.com/Atinux) for the suggestion\n * to implement this method.\n *\n * @return {Object} - new meta info\n */\n\n\nfunction refresh(rootVm, options) {\n options = options || {}; // make sure vue-meta was initiated\n\n if (!rootVm[rootConfigKey]) {\n showWarningNotSupported();\n return {};\n } // collect & aggregate all metaInfo $options\n\n\n var rawInfo = getComponentMetaInfo(options, rootVm);\n var metaInfo = getMetaInfo(options, rawInfo, clientSequences, rootVm);\n var appId = rootVm[rootConfigKey].appId;\n var tags = updateClientMetaInfo(appId, options, metaInfo); // emit \"event\" with new info\n\n if (tags && isFunction(metaInfo.changed)) {\n metaInfo.changed(metaInfo, tags.tagsAdded, tags.tagsRemoved);\n tags = {\n addedTags: tags.tagsAdded,\n removedTags: tags.tagsRemoved\n };\n }\n\n var appsMetaInfo = getAppsMetaInfo();\n\n if (appsMetaInfo) {\n for (var additionalAppId in appsMetaInfo) {\n updateClientMetaInfo(additionalAppId, options, appsMetaInfo[additionalAppId]);\n delete appsMetaInfo[additionalAppId];\n }\n\n clearAppsMetaInfo(true);\n }\n\n return {\n vm: rootVm,\n metaInfo: metaInfo,\n // eslint-disable-line object-shorthand\n tags: tags\n };\n}\n/**\n * Generates tag attributes for use on the server.\n *\n * @param {('bodyAttrs'|'htmlAttrs'|'headAttrs')} type - the type of attributes to generate\n * @param {Object} data - the attributes to generate\n * @return {Object} - the attribute generator\n */\n\n\nfunction attributeGenerator(options, type, data, _ref) {\n var addSsrAttribute = _ref.addSsrAttribute;\n\n var _ref2 = options || {},\n attribute = _ref2.attribute,\n ssrAttribute = _ref2.ssrAttribute;\n\n var attributeStr = '';\n\n for (var attr in data) {\n var attrData = data[attr];\n var attrValues = [];\n\n for (var appId in attrData) {\n attrValues.push.apply(attrValues, _toConsumableArray([].concat(attrData[appId])));\n }\n\n if (attrValues.length) {\n attributeStr += booleanHtmlAttributes.includes(attr) && attrValues.some(Boolean) ? \"\".concat(attr) : \"\".concat(attr, \"=\\\"\").concat(attrValues.join(' '), \"\\\"\");\n attributeStr += ' ';\n }\n }\n\n if (attributeStr) {\n attributeStr += \"\".concat(attribute, \"=\\\"\").concat(encodeURI(JSON.stringify(data)), \"\\\"\");\n }\n\n if (type === 'htmlAttrs' && addSsrAttribute) {\n return \"\".concat(ssrAttribute).concat(attributeStr ? ' ' : '').concat(attributeStr);\n }\n\n return attributeStr;\n}\n/**\n * Generates title output for the server\n *\n * @param {'title'} type - the string \"title\"\n * @param {String} data - the title text\n * @return {Object} - the title generator\n */\n\n\nfunction titleGenerator(options, type, data, generatorOptions) {\n var _ref = generatorOptions || {},\n ln = _ref.ln;\n\n if (!data) {\n return '';\n }\n\n return \"<\".concat(type, \">\").concat(data, \"\").concat(ln ? '\\n' : '');\n}\n/**\n * Generates meta, base, link, style, script, noscript tags for use on the server\n *\n * @param {('meta'|'base'|'link'|'style'|'script'|'noscript')} the name of the tag\n * @param {(Array|Object)} tags - an array of tag objects or a single object in case of base\n * @return {Object} - the tag generator\n */\n\n\nfunction tagGenerator(options, type, tags, generatorOptions) {\n var _ref = options || {},\n ssrAppId = _ref.ssrAppId,\n attribute = _ref.attribute,\n tagIDKeyName = _ref.tagIDKeyName;\n\n var _ref2 = generatorOptions || {},\n appId = _ref2.appId,\n _ref2$isSSR = _ref2.isSSR,\n isSSR = _ref2$isSSR === void 0 ? true : _ref2$isSSR,\n _ref2$body = _ref2.body,\n body = _ref2$body === void 0 ? false : _ref2$body,\n _ref2$pbody = _ref2.pbody,\n pbody = _ref2$pbody === void 0 ? false : _ref2$pbody,\n _ref2$ln = _ref2.ln,\n ln = _ref2$ln === void 0 ? false : _ref2$ln;\n\n var dataAttributes = [tagIDKeyName].concat(_toConsumableArray(commonDataAttributes));\n\n if (!tags || !tags.length) {\n return '';\n } // build a string containing all tags of this type\n\n\n return tags.reduce(function (tagsStr, tag) {\n if (tag.skip) {\n return tagsStr;\n }\n\n var tagKeys = Object.keys(tag);\n\n if (tagKeys.length === 0) {\n return tagsStr; // Bail on empty tag object\n }\n\n if (Boolean(tag.body) !== body || Boolean(tag.pbody) !== pbody) {\n return tagsStr;\n }\n\n var attrs = tag.once ? '' : \" \".concat(attribute, \"=\\\"\").concat(appId || (isSSR === false ? '1' : ssrAppId), \"\\\"\"); // build a string containing all attributes of this tag\n\n for (var attr in tag) {\n // these attributes are treated as children on the tag\n if (tagAttributeAsInnerContent.includes(attr) || tagProperties.includes(attr)) {\n continue;\n }\n\n if (attr === 'callback') {\n attrs += ' onload=\"this.__vm_l=1\"';\n continue;\n } // these form the attribute list for this tag\n\n\n var prefix = '';\n\n if (dataAttributes.includes(attr)) {\n prefix = 'data-';\n }\n\n var isBooleanAttr = !prefix && booleanHtmlAttributes.includes(attr);\n\n if (isBooleanAttr && !tag[attr]) {\n continue;\n }\n\n attrs += \" \".concat(prefix).concat(attr) + (isBooleanAttr ? '' : \"=\\\"\".concat(tag[attr], \"\\\"\"));\n }\n\n var json = '';\n\n if (tag.json) {\n json = JSON.stringify(tag.json);\n } // grab child content from one of these attributes, if possible\n\n\n var content = tag.innerHTML || tag.cssText || json; // generate tag exactly without any other redundant attribute\n // these tags have no end tag\n\n var hasEndTag = !tagsWithoutEndTag.includes(type); // these tag types will have content inserted\n\n var hasContent = hasEndTag && tagsWithInnerContent.includes(type); // the final string for this specific tag\n\n return \"\".concat(tagsStr, \"<\").concat(type).concat(attrs).concat(!hasContent && hasEndTag ? '/' : '', \">\") + (hasContent ? \"\".concat(content, \"\") : '') + (ln ? '\\n' : '');\n }, '');\n}\n/**\n * Converts a meta info property to one that can be stringified on the server\n *\n * @param {String} type - the type of data to convert\n * @param {(String|Object|Array)} data - the data value\n * @return {Object} - the new injector\n */\n\n\nfunction generateServerInjector(options, metaInfo, globalInjectOptions) {\n var serverInjector = {\n data: metaInfo,\n extraData: undefined,\n addInfo: function addInfo(appId, metaInfo) {\n this.extraData = this.extraData || {};\n this.extraData[appId] = metaInfo;\n },\n callInjectors: function callInjectors(opts) {\n var m = this.injectors; // only call title for the head\n\n return (opts.body || opts.pbody ? '' : m.title.text(opts)) + m.meta.text(opts) + m.base.text(opts) + m.link.text(opts) + m.style.text(opts) + m.script.text(opts) + m.noscript.text(opts);\n },\n injectors: {\n head: function head(ln) {\n return serverInjector.callInjectors(_objectSpread2(_objectSpread2({}, globalInjectOptions), {}, {\n ln: ln\n }));\n },\n bodyPrepend: function bodyPrepend(ln) {\n return serverInjector.callInjectors(_objectSpread2(_objectSpread2({}, globalInjectOptions), {}, {\n ln: ln,\n pbody: true\n }));\n },\n bodyAppend: function bodyAppend(ln) {\n return serverInjector.callInjectors(_objectSpread2(_objectSpread2({}, globalInjectOptions), {}, {\n ln: ln,\n body: true\n }));\n }\n }\n };\n\n var _loop = function _loop(type) {\n if (metaInfoOptionKeys.includes(type)) {\n return \"continue\";\n }\n\n serverInjector.injectors[type] = {\n text: function text(injectOptions) {\n var addSsrAttribute = injectOptions === true;\n injectOptions = _objectSpread2(_objectSpread2({\n addSsrAttribute: addSsrAttribute\n }, globalInjectOptions), injectOptions);\n\n if (type === 'title') {\n return titleGenerator(options, type, serverInjector.data[type], injectOptions);\n }\n\n if (metaInfoAttributeKeys.includes(type)) {\n var attributeData = {};\n var data = serverInjector.data[type];\n\n if (data) {\n var appId = injectOptions.isSSR === false ? '1' : options.ssrAppId;\n\n for (var attr in data) {\n attributeData[attr] = _defineProperty({}, appId, data[attr]);\n }\n }\n\n if (serverInjector.extraData) {\n for (var _appId in serverInjector.extraData) {\n var _data = serverInjector.extraData[_appId][type];\n\n if (_data) {\n for (var _attr in _data) {\n attributeData[_attr] = _objectSpread2(_objectSpread2({}, attributeData[_attr]), {}, _defineProperty({}, _appId, _data[_attr]));\n }\n }\n }\n }\n\n return attributeGenerator(options, type, attributeData, injectOptions);\n }\n\n var str = tagGenerator(options, type, serverInjector.data[type], injectOptions);\n\n if (serverInjector.extraData) {\n for (var _appId2 in serverInjector.extraData) {\n var _data2 = serverInjector.extraData[_appId2][type];\n var extraStr = tagGenerator(options, type, _data2, _objectSpread2({\n appId: _appId2\n }, injectOptions));\n str = \"\".concat(str).concat(extraStr);\n }\n }\n\n return str;\n }\n };\n };\n\n for (var type in defaultInfo) {\n var _ret = _loop(type);\n\n if (_ret === \"continue\") continue;\n }\n\n return serverInjector;\n}\n/**\n * Converts the state of the meta info object such that each item\n * can be compiled to a tag string on the server\n *\n * @vm {Object} - Vue instance - ideally the root component\n * @return {Object} - server meta info with `toString` methods\n */\n\n\nfunction inject(rootVm, options, injectOptions) {\n // make sure vue-meta was initiated\n if (!rootVm[rootConfigKey]) {\n showWarningNotSupported();\n return {};\n } // collect & aggregate all metaInfo $options\n\n\n var rawInfo = getComponentMetaInfo(options, rootVm);\n var metaInfo = getMetaInfo(options, rawInfo, serverSequences, rootVm); // generate server injector\n\n var serverInjector = generateServerInjector(options, metaInfo, injectOptions); // add meta info from additional apps\n\n var appsMetaInfo = getAppsMetaInfo();\n\n if (appsMetaInfo) {\n for (var additionalAppId in appsMetaInfo) {\n serverInjector.addInfo(additionalAppId, appsMetaInfo[additionalAppId]);\n delete appsMetaInfo[additionalAppId];\n }\n\n clearAppsMetaInfo(true);\n }\n\n return serverInjector.injectors;\n}\n\nfunction $meta(options) {\n options = options || {};\n /**\n * Returns an injector for server-side rendering.\n * @this {Object} - the Vue instance (a root component)\n * @return {Object} - injector\n */\n\n var $root = this.$root;\n return {\n getOptions: function getOptions$1() {\n return getOptions(options);\n },\n setOptions: function setOptions(newOptions) {\n var refreshNavKey = 'refreshOnceOnNavigation';\n\n if (newOptions && newOptions[refreshNavKey]) {\n options.refreshOnceOnNavigation = !!newOptions[refreshNavKey];\n addNavGuards($root);\n }\n\n var debounceWaitKey = 'debounceWait';\n\n if (newOptions && debounceWaitKey in newOptions) {\n var debounceWait = parseInt(newOptions[debounceWaitKey]);\n\n if (!isNaN(debounceWait)) {\n options.debounceWait = debounceWait;\n }\n }\n\n var waitOnDestroyedKey = 'waitOnDestroyed';\n\n if (newOptions && waitOnDestroyedKey in newOptions) {\n options.waitOnDestroyed = !!newOptions[waitOnDestroyedKey];\n }\n },\n refresh: function refresh$1() {\n return refresh($root, options);\n },\n inject: function inject$1(injectOptions) {\n return inject($root, options, injectOptions);\n },\n pause: function pause$1() {\n return pause($root);\n },\n resume: function resume$1() {\n return resume($root);\n },\n addApp: function addApp$1(appId) {\n return addApp($root, appId, options);\n }\n };\n}\n\nfunction generate(rawInfo, options) {\n options = setOptions(options);\n var metaInfo = getMetaInfo(options, rawInfo, serverSequences);\n var serverInjector = generateServerInjector(options, metaInfo);\n return serverInjector.injectors;\n}\n/**\n * Plugin install function.\n * @param {Function} Vue - the Vue constructor.\n */\n\n\nfunction install(Vue, options) {\n if (Vue.__vuemeta_installed) {\n return;\n }\n\n Vue.__vuemeta_installed = true;\n options = setOptions(options);\n\n Vue.prototype.$meta = function () {\n return $meta.call(this, options);\n };\n\n Vue.mixin(createMixin(Vue, options));\n}\n\nvar index = {\n version: version,\n install: install,\n generate: function generate$1(metaInfo, options) {\n return generate(metaInfo, options);\n },\n hasMetaInfo: hasMetaInfo\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (index);\n\n//# sourceURL=webpack://materio.com/./node_modules/vue-meta/dist/vue-meta.esm.js?"); + +/***/ }), + /***/ "./node_modules/vue-router/dist/vue-router.esm.js": /*!********************************************************!*\ !*** ./node_modules/vue-router/dist/vue-router.esm.js ***! @@ -1459,7 +1487,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n})); /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\n// import { JSONAPI } from 'vuejs/api/json-axios'\n// import { MA } from 'vuejs/api/ma-axios'\n// import qs from 'querystring-es3'\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n contenttype: null,\n items: [],\n page: 0,\n // infinteState will come from vue-infinite-loading plugin\n // implemented in vuejs/components/Content/Base.vue\n infiniteLoadingState: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setItems: function setItems(state, items) {\n state.items = state.items.concat(items);\n },\n incrementPage: function incrementPage(state) {\n state.page += 1;\n },\n setInfiniteState: function setInfiniteState(state, infiniteLoadingstate) {\n state.infiniteLoadingState = infiniteLoadingstate;\n }\n },\n // actions\n actions: {\n getItems: function getItems(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n // if(!state.contenttype){\n // REST.get('/entity/node_type/article?_format=json', {})\n // .then(({ data }) => {\n // console.log('blabla REST contenttype : data', data);\n // })\n // .catch(( error ) => {\n // console.warn('Issue with blabla contenttype', error)\n // Promise.reject(error)\n // })\n // }\n return _restAxios.REST.get(\"/blabla_rest?_format=json&page=\".concat(state.page), {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('blabla REST: data', data);\n\n if (data.length) {\n commit('setItems', data); // console.log('items.length', this.items.length);\n\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.loaded();\n }\n } else {\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.complete();\n }\n }\n }).catch(function (error) {\n console.warn('Issue with blabla getitems', error);\n Promise.reject(error);\n });\n },\n nextPage: function nextPage(_ref3, $infiniteLoadingstate) {\n var dispatch = _ref3.dispatch,\n commit = _ref3.commit,\n state = _ref3.state;\n console.log('blabla nextPage', $infiniteLoadingstate);\n commit('incrementPage');\n commit('setInfiniteState', $infiniteLoadingstate);\n dispatch('getItems');\n },\n getItemIndex: function getItemIndex(_ref4, nid) {\n var dispatch = _ref4.dispatch,\n commit = _ref4.commit,\n state = _ref4.state;\n return state.items.findIndex(function (e) {\n return e.nid == nid;\n });\n },\n getPrevNextItems: function getPrevNextItems(_ref5, index) {\n var dispatch = _ref5.dispatch,\n commit = _ref5.commit,\n state = _ref5.state;\n return {\n prev: state.items[index - 1],\n next: state.items[index + 1]\n };\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/blabla.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", ({\n value: true\n}));\nexports.default = void 0;\n\nvar _restAxios = __webpack_require__(/*! vuejs/api/rest-axios */ \"./web/themes/custom/materiotheme/vuejs/api/rest-axios.js\");\n\n// import { JSONAPI } from 'vuejs/api/json-axios'\n// import { MA } from 'vuejs/api/ma-axios'\n// import qs from 'querystring-es3'\nvar _default = {\n namespaced: true,\n // initial state\n state: {\n contenttype: null,\n items: [],\n page: 0,\n // infinteState will come from vue-infinite-loading plugin\n // implemented in vuejs/components/Content/Base.vue\n infiniteLoadingState: null\n },\n // getters\n getters: {},\n // mutations\n mutations: {\n setItems: function setItems(state, items) {\n state.items = state.items.concat(items);\n },\n incrementPage: function incrementPage(state) {\n state.page += 1;\n },\n setInfiniteState: function setInfiniteState(state, infiniteLoadingstate) {\n state.infiniteLoadingState = infiniteLoadingstate;\n }\n },\n // actions\n actions: {\n getItems: function getItems(_ref) {\n var dispatch = _ref.dispatch,\n commit = _ref.commit,\n state = _ref.state;\n // if(!state.contenttype){\n // REST.get('/entity/node_type/article?_format=json', {})\n // .then(({ data }) => {\n // console.log('blabla REST contenttype : data', data);\n // })\n // .catch(( error ) => {\n // console.warn('Issue with blabla contenttype', error)\n // Promise.reject(error)\n // })\n // }\n return _restAxios.REST.get(\"/blabla_rest?_format=json&page=\".concat(state.page), {}).then(function (_ref2) {\n var data = _ref2.data;\n console.log('blabla REST: data', data);\n\n if (data.length) {\n commit('setItems', data); // console.log('items.length', this.items.length);\n\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.loaded();\n }\n } else {\n if (state.infiniteLoadingState) {\n state.infiniteLoadingState.complete();\n }\n }\n }).catch(function (error) {\n console.warn('Issue with blabla getitems', error);\n Promise.reject(error);\n });\n },\n nextPage: function nextPage(_ref3, $infiniteLoadingstate) {\n var dispatch = _ref3.dispatch,\n commit = _ref3.commit,\n state = _ref3.state;\n console.log('blabla nextPage', $infiniteLoadingstate);\n commit('incrementPage');\n commit('setInfiniteState', $infiniteLoadingstate);\n dispatch('getItems');\n },\n getItemIndex: function getItemIndex(_ref4, nid) {\n var dispatch = _ref4.dispatch,\n commit = _ref4.commit,\n state = _ref4.state;\n console.log('getItemIndex nid', nid);\n return state.items.findIndex(function (e) {\n // console.log('findIndex', e, nid);\n return e.nid === nid;\n });\n },\n getPrevNextItems: function getPrevNextItems(_ref5, index) {\n var dispatch = _ref5.dispatch,\n commit = _ref5.commit,\n state = _ref5.state;\n // TODO: preload prev and next items\n return {\n prev: state.items[index - 1],\n next: state.items[index + 1]\n };\n }\n }\n};\nexports.default = _default;\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/store/modules/blabla.js?"); /***/ }), @@ -3175,7 +3203,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.article || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\"article\", { staticClass: \"article\" }, [\n _c(\"nav\", { staticClass: \"prevnext top\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrev($event)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onNext($event)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"cols\" }, [\n _c(\"div\", { staticClass: \"col col-left\" }, [\n _vm.image_accroche\n ? _c(\"section\", { staticClass: \"accroche\" }, [\n _c(\"figure\", [\n _c(\"img\", {\n attrs: {\n src: _vm.image_accroche.url,\n alt: _vm.image_accroche.alt,\n title: _vm.image_accroche.title\n },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(0)\n }\n }\n })\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"taxonomy\" }, [\n _c(\"div\", { staticClass: \"thesaurus\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.article.thesaurus, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tags\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.article.tags, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _vm.article.showroom\n ? _c(\"section\", { staticClass: \"showroom\" }, [\n _c(\"h2\", [_vm._v(_vm._s(_vm.article.showroom.name))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"mail\",\n attrs: {\n href: \"mail:\" + _vm.article.showroom.field_public_email\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.article.showroom.field_public_email)\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"phone\",\n attrs: {\n href: \"tel:\" + _vm.article.showroom.field_public_phone\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.article.showroom.field_public_phone)\n )\n ]\n )\n ])\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"col col-right\" },\n [\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.article.body) }\n }),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.lightbox_items,\n index: _vm.lightbox_index,\n loop: true,\n srcName: \"url\"\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n }),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"gallery-wrapper\" },\n _vm._l(_vm.lightbox_items, function(image, imageIndex) {\n return imageIndex > 0\n ? _c(\"div\", {\n key: imageIndex,\n staticClass: \"image\",\n style: { backgroundImage: \"url(\" + image.thumb + \")\" },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(imageIndex)\n }\n }\n })\n : _vm._e()\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"aside\", { staticClass: \"linked-materials\" }, [\n _c(\"h3\", { staticClass: \"field__label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Linked Materials\")))\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-list\" }, [\n _c(\n \"ul\",\n {},\n _vm._l(_vm.article.linked_materials, function(node) {\n return _c(\n \"li\",\n { key: node.id },\n [_c(\"Card\", { attrs: { item: node } })],\n 1\n )\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"prevnext bottom\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrev($event)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: \"#\" },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onNext($event)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"render\": () => /* binding */ render,\n/* harmony export */ \"staticRenderFns\": () => /* binding */ staticRenderFns\n/* harmony export */ });\nvar render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return !_vm.article || _vm.loading\n ? _c(\"div\", { staticClass: \"loading\" }, [\n _c(\"span\", [_vm._v(\"Loading ...\")])\n ])\n : _c(\"article\", { staticClass: \"article\" }, [\n _c(\"nav\", { staticClass: \"prevnext top\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: _vm.prevnext.prev.view_node },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrevNext(_vm.prevnext.prev.view_node)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: _vm.prevnext.next.view_node },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrevNext(_vm.prevnext.next.view_node)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"cols\" }, [\n _c(\"div\", { staticClass: \"col col-left\" }, [\n _vm.image_accroche\n ? _c(\"section\", { staticClass: \"accroche\" }, [\n _c(\"figure\", [\n _c(\"img\", {\n attrs: {\n src: _vm.image_accroche.url,\n alt: _vm.image_accroche.alt,\n title: _vm.image_accroche.title\n },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(0)\n }\n }\n })\n ])\n ])\n : _vm._e(),\n _vm._v(\" \"),\n _c(\"section\", { staticClass: \"taxonomy\" }, [\n _c(\"div\", { staticClass: \"thesaurus\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.article.thesaurus, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"tags\" }, [\n _c(\n \"ul\",\n _vm._l(_vm.article.tags, function(term) {\n return _c(\"li\", { key: term.id }, [\n _vm._v(_vm._s(term.name))\n ])\n }),\n 0\n )\n ])\n ]),\n _vm._v(\" \"),\n _vm.article.showroom\n ? _c(\"section\", { staticClass: \"showroom\" }, [\n _c(\"h2\", [_vm._v(_vm._s(_vm.article.showroom.name))]),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"mail\",\n attrs: {\n href: \"mail:\" + _vm.article.showroom.field_public_email\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.article.showroom.field_public_email)\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\"br\"),\n _vm._v(\" \"),\n _c(\n \"a\",\n {\n staticClass: \"phone\",\n attrs: {\n href: \"tel:\" + _vm.article.showroom.field_public_phone\n }\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(_vm.article.showroom.field_public_phone)\n )\n ]\n )\n ])\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"col col-right\" },\n [\n _c(\"section\", {\n staticClass: \"body\",\n domProps: { innerHTML: _vm._s(_vm.article.body) }\n }),\n _vm._v(\" \"),\n _c(\"CoolLightBox\", {\n attrs: {\n items: _vm.lightbox_items,\n index: _vm.lightbox_index,\n loop: true,\n srcName: \"url\"\n },\n on: {\n close: function($event) {\n _vm.lightbox_index = null\n }\n }\n }),\n _vm._v(\" \"),\n _c(\n \"div\",\n { staticClass: \"gallery-wrapper\" },\n _vm._l(_vm.lightbox_items, function(image, imageIndex) {\n return imageIndex > 0\n ? _c(\"div\", {\n key: imageIndex,\n staticClass: \"image\",\n style: { backgroundImage: \"url(\" + image.thumb + \")\" },\n on: {\n click: function($event) {\n return _vm.setLightboxIndex(imageIndex)\n }\n }\n })\n : _vm._e()\n }),\n 0\n ),\n _vm._v(\" \"),\n _c(\"aside\", { staticClass: \"linked-materials\" }, [\n _c(\"h3\", { staticClass: \"field__label\" }, [\n _vm._v(_vm._s(_vm.$t(\"materio.Linked Materials\")))\n ]),\n _vm._v(\" \"),\n _c(\"div\", { staticClass: \"card-list\" }, [\n _c(\n \"ul\",\n {},\n _vm._l(_vm.article.linked_materials, function(node) {\n return _c(\n \"li\",\n { key: node.id },\n [_c(\"Card\", { attrs: { item: node } })],\n 1\n )\n }),\n 0\n )\n ])\n ])\n ],\n 1\n )\n ]),\n _vm._v(\" \"),\n _c(\"nav\", { staticClass: \"prevnext bottom\" }, [\n _c(\"ul\", [\n _c(\"li\", [\n _vm.prevnext.prev\n ? _c(\"a\", {\n attrs: { href: _vm.prevnext.prev.view_node },\n domProps: { innerHTML: _vm._s(_vm.prevnext.prev.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrevNext(_vm.prevnext.prev.view_node)\n }\n }\n })\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _c(\"li\", [\n _vm.prevnext.next\n ? _c(\"a\", {\n attrs: { href: _vm.prevnext.next.view_node },\n domProps: { innerHTML: _vm._s(_vm.prevnext.next.title) },\n on: {\n click: function($event) {\n $event.preventDefault()\n return _vm.onPrevNext(_vm.prevnext.next.view_node)\n }\n }\n })\n : _vm._e()\n ])\n ])\n ])\n ])\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\n\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue?./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib/index.js??vue-loader-options"); /***/ }), @@ -16950,6 +16978,18 @@ eval("module.exports = JSON.parse(\"{\\\"default\\\":{\\\"Closing in !seconds se /******/ } /******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => module['default'] : +/******/ () => module; +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/define property getters */ /******/ (() => { /******/ // define getter functions for harmony exports @@ -16998,7 +17038,7 @@ eval("module.exports = JSON.parse(\"{\\\"default\\\":{\\\"Closing in !seconds se \***************************************************************/ /*! unknown exports (runtime-defined) */ /*! runtime requirements: __webpack_require__ */ -eval("\n\nvar _vue = _interopRequireDefault(__webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.js\"));\n\nvar _vueInfiniteLoading = _interopRequireDefault(__webpack_require__(/*! vue-infinite-loading */ \"./node_modules/vue-infinite-loading/dist/vue-infinite-loading.js\"));\n\nvar _vueCoolLightbox = _interopRequireDefault(__webpack_require__(/*! vue-cool-lightbox */ \"./node_modules/vue-cool-lightbox/dist/vue-cool-lightbox.esm.js\"));\n\nvar _vueJsModal = _interopRequireDefault(__webpack_require__(/*! vue-js-modal */ \"./node_modules/vue-js-modal/dist/index.js\"));\n\nvar _store = _interopRequireDefault(__webpack_require__(/*! vuejs/store */ \"./web/themes/custom/materiotheme/vuejs/store/index.js\"));\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nvar _i18n = __webpack_require__(/*! vuejs/i18n */ \"./web/themes/custom/materiotheme/vuejs/i18n/index.js\");\n\nvar _UserBlock = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Block/UserBlock */ \"./web/themes/custom/materiotheme/vuejs/components/Block/UserBlock.vue\"));\n\nvar _MainContent = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/MainContent */ \"./web/themes/custom/materiotheme/vuejs/components/Content/MainContent.vue\"));\n\nvar _SearchBlock = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Block/SearchBlock */ \"./web/themes/custom/materiotheme/vuejs/components/Block/SearchBlock.vue\"));\n\nvar _LeftContent = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/LeftContent */ \"./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\n__webpack_require__(/*! vue-cool-lightbox/dist/vue-cool-lightbox.min.css */ \"./node_modules/vue-cool-lightbox/dist/vue-cool-lightbox.min.css\");\n\n__webpack_require__(/*! theme/assets/styles/main.scss */ \"./web/themes/custom/materiotheme/assets/styles/main.scss\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n_vue.default.use(_vueInfiniteLoading.default, {\n props: {\n spinner: 'spiral' // slots.noMore: ''\n\n } // system: {\n // throttleLimit: 50,\n // /* other settings need to configure */\n // }\n\n}); // import vueVimeoPlayer from 'vue-vimeo-player'\n// Vue.use(vueVimeoPlayer)\n// import VueYouTubeEmbed from 'vue-youtube-embed'\n// Vue.use(VueYouTubeEmbed)\n\n\n_vue.default.use(_vueCoolLightbox.default);\n\n_vue.default.use(_vueJsModal.default);\n\n(function (Drupal, drupalSettings, drupalDecoupled) {\n var MaterioTheme = function MaterioTheme() {\n var _v_sitebranding_block, _v_user_block, _v_header_menu, _v_pagetitle_block, _v_search_block, _v_main_content, _v_left_content;\n\n var _is_front = drupalSettings.path.isFront;\n console.log('drupalSettings', drupalSettings); // let _I18n\n // ___ _ _\n // |_ _|_ _ (_) |_\n // | || ' \\| | _|\n // |___|_||_|_|\\__|\n\n function init() {\n console.log('MaterioTheme init()');\n initVues();\n }\n\n function checkNoVuePages() {\n // return drupalDecoupled.sys_path != '/cart'\n // && drupalDecoupled.sys_path.indexOf('checkout') != 1;\n if (drupalDecoupled.route_name.indexOf('commerce') == -1 && drupalDecoupled.route_name.indexOf('flagging_collection') == -1 && drupalDecoupled.route_name.indexOf('user') == -1) {\n return false;\n } else {\n return true;\n }\n }\n\n function initVues() {\n // only launch views if we are not in commerce pages\n if (!checkNoVuePages()) {\n initVi18n();\n initVStore();\n initVRouter();\n initVSiteBrandingBlock();\n initVPagetitleBlock();\n initVHeaderMenu();\n initVMainContent();\n initVSearchBlock();\n initVLeftContent();\n }\n\n initVUserBlock();\n }\n\n function initVi18n() {\n // i18n.locale = drupalDecoupled.lang_code\n // console.log('i18n.messages', i18n.messages)\n (0, _i18n.loadLanguageAsync)(drupalDecoupled.lang_code).then(function () {\n console.log('main.js language loaded');\n });\n }\n\n function initVStore() {\n _store.default.dispatch('Showrooms/getItems');\n }\n\n function initVRouter() {\n // we need this to update the title and body classes while using history nav\n _route.default.beforeEach(function (to, from, next) {\n var _document$querySelect, _document$querySelect2;\n\n // console.log('router beforeEach to ', to);\n // commit new title to store\n var title = null;\n\n switch (to.name) {\n case 'home':\n title = null;\n break;\n\n case 'article':\n title = false;\n break;\n\n default:\n title = to.name;\n }\n\n if (title !== false) {\n _store.default.commit('Common/setPagetitle', title);\n } // remove all path related body classes\n\n\n var body_classes = document.querySelector('body').classList;\n var classes_to_rm = [];\n\n for (var i = 0; i < body_classes.length; i++) {\n if (body_classes[i].startsWith('path-')) {\n classes_to_rm.push(body_classes[i]);\n }\n }\n\n (_document$querySelect = document.querySelector('body').classList).remove.apply(_document$querySelect, classes_to_rm); // add new path classes to body\n\n\n var classes = [];\n\n if (to.path == '/') {\n classes.push('path-home');\n } else {\n var path_parts = to.path.replace(/^\\//, '').split('/'); // TODO: remove language relative prefix from path classes (fr, en, etc)\n\n for (var i = 0; i < path_parts.length; i++) {\n if (i == 0) {\n var c = 'path-' + path_parts[i];\n } else if (path_parts[i] !== '') {\n var c = classes[i - 1] + '-' + path_parts[i];\n }\n\n classes.push(c);\n }\n }\n\n (_document$querySelect2 = document.querySelector('body').classList).add.apply(_document$querySelect2, classes); // trigger router\n\n\n next();\n });\n }\n\n function initVSiteBrandingBlock() {\n _v_sitebranding_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n router: _route.default,\n el: '#block-sitebranding',\n methods: {\n onclick: function onclick(event) {\n // console.log(\"Clicked on logo event\", event);\n var href = event.target.getAttribute('href'); // console.log(\"Clicked on logo href\", href);\n\n this.$router.push(href); // replaced by router.beforeEach\n // this.$store.commit('Common/setPagetitle', null)\n }\n }\n });\n }\n\n function initVPagetitleBlock() {\n var $blk = document.querySelector('#block-pagetitle');\n var $h2 = $blk.querySelector('h2'); // get the loaded pagetitle\n\n var title = $h2.innerText; // if not front recorde the loaded pagetitle in store\n\n if (!_is_front) {\n _store.default.commit('Common/setPagetitle', title);\n } // replace in template the pagetitle by vue binding\n\n\n $h2.innerText = '{{ pagetitle }}'; // create the vue\n\n _v_pagetitle_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n router: _route.default,\n el: $blk,\n computed: _objectSpread({}, (0, _vuex.mapState)({\n pagetitle: function pagetitle(state) {\n return state.Common.pagetitle;\n }\n }))\n });\n }\n\n function initVUserBlock() {\n var mount_point = drupalSettings.user.uid !== 0 ? 'block-userblock' : 'block-userlogin';\n var props = {\n title: '',\n loginblock: ''\n };\n var $block;\n\n switch (mount_point) {\n case 'block-userlogin':\n $block = document.getElementById(mount_point);\n console.log('initVUserBlock login form html', $block);\n props.loginblock = $block.outerHTML.trim();\n break;\n\n case 'block-userblock':\n default:\n break;\n }\n\n _v_user_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n // computed: {\n // ...mapState({\n // isloggedin: state => state.User.isloggedin\n // })\n // },\n created: function created() {\n // if already loggedin, call store.user to get the user infos\n if (drupalSettings.user.uid !== 0) {\n this.$store.commit('User/setUid', drupalSettings.user.uid);\n this.$store.dispatch('User/getUser');\n }\n },\n render: function render(h) {\n return h(_UserBlock.default, {\n props: props\n });\n }\n }).$mount('#' + mount_point); // console.log('initVUserBlock', _v_user_block);\n }\n\n function initVHeaderMenu() {\n // console.log('initVHeaderMenu');\n // adding vuejs attributes has it wont work on twig template (see menu--header.html.twig)\n // not working : String contains an invalid character\n // document.querySelectorAll(`#block-header a`).forEach(link => {\n // console.log(link);\n // link.setAttribute('@click.prevent', 'onclick')\n // });\n _v_header_menu = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n router: _route.default,\n el: '#block-header',\n methods: {\n onclick: function onclick(event) {\n // console.log(\"Clicked on header menu link\", event);\n var href = event.target.getAttribute('href'); // let title = event.target.innerText;\n // console.log(\"Clicked on header menu link : href\", href);\n\n this.$router.push(href); // replaced by router.beforeEach\n // this.$store.commit('Common/setPagetitle', title)\n }\n }\n });\n }\n\n function initVMainContent() {\n var id = 'main-content';\n var $main_content = document.querySelector('#' + id); // console.log('main-content', $main_content);\n\n var main_html = $main_content.innerHTML;\n _v_main_content = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n render: function render(h) {\n return h(_MainContent.default, {\n props: {\n id: id,\n html: main_html,\n isfront: drupalSettings.path.isFront\n }\n });\n }\n }).$mount('#' + id);\n }\n\n function initVSearchBlock() {\n // console.log('initVSearchBlock');\n var id = 'block-materiosapisearchblock';\n var $search_block = document.getElementById(id);\n var formhtml = null;\n\n if ($search_block) {\n // get the search form html to pass it as template to the vue\n // we gain display speed vs async downloaded data\n formhtml = $search_block.innerHTML;\n } else {\n // else create the empty block to fill it later with async data\n $search_block = document.createElement('div');\n $search_block.setAttribute('id', id); // TODO: get region by REST\n\n var $region = document.getElementById('header-bottom');\n $region.appendChild($search_block);\n } // in any case create the vue\n\n\n _v_search_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n render: function render(h) {\n return h(_SearchBlock.default, {\n props: {\n blockid: id,\n formhtml: formhtml\n }\n });\n }\n }).$mount('#' + id);\n }\n\n function initVLeftContent() {\n var id = 'content-left';\n var $leftContent = document.getElementById(id); // in any case create the vue\n\n _v_left_content = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n render: function render(h) {\n return h(_LeftContent.default, {\n props: {\n id: id\n }\n });\n }\n }).$mount('#' + id);\n }\n\n init();\n }; // end MaterioTheme()\n\n\n var materiotheme = new MaterioTheme();\n})(Drupal, drupalSettings, drupalDecoupled);\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/assets/scripts/main.js?"); +eval("\n\nvar _vue = _interopRequireDefault(__webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.js\"));\n\nvar _vueInfiniteLoading = _interopRequireDefault(__webpack_require__(/*! vue-infinite-loading */ \"./node_modules/vue-infinite-loading/dist/vue-infinite-loading.js\"));\n\nvar _vueCoolLightbox = _interopRequireDefault(__webpack_require__(/*! vue-cool-lightbox */ \"./node_modules/vue-cool-lightbox/dist/vue-cool-lightbox.esm.js\"));\n\nvar _vueJsModal = _interopRequireDefault(__webpack_require__(/*! vue-js-modal */ \"./node_modules/vue-js-modal/dist/index.js\"));\n\nvar _store = _interopRequireDefault(__webpack_require__(/*! vuejs/store */ \"./web/themes/custom/materiotheme/vuejs/store/index.js\"));\n\nvar _route = _interopRequireDefault(__webpack_require__(/*! vuejs/route */ \"./web/themes/custom/materiotheme/vuejs/route/index.js\"));\n\nvar _i18n = __webpack_require__(/*! vuejs/i18n */ \"./web/themes/custom/materiotheme/vuejs/i18n/index.js\");\n\nvar _vueMeta = _interopRequireDefault(__webpack_require__(/*! vue-meta */ \"./node_modules/vue-meta/dist/vue-meta.esm.js\"));\n\nvar _UserBlock = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Block/UserBlock */ \"./web/themes/custom/materiotheme/vuejs/components/Block/UserBlock.vue\"));\n\nvar _MainContent = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/MainContent */ \"./web/themes/custom/materiotheme/vuejs/components/Content/MainContent.vue\"));\n\nvar _SearchBlock = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Block/SearchBlock */ \"./web/themes/custom/materiotheme/vuejs/components/Block/SearchBlock.vue\"));\n\nvar _LeftContent = _interopRequireDefault(__webpack_require__(/*! vuejs/components/Content/LeftContent */ \"./web/themes/custom/materiotheme/vuejs/components/Content/LeftContent.vue\"));\n\nvar _vuex = __webpack_require__(/*! vuex */ \"./node_modules/vuex/dist/vuex.common.js\");\n\n__webpack_require__(/*! vue-cool-lightbox/dist/vue-cool-lightbox.min.css */ \"./node_modules/vue-cool-lightbox/dist/vue-cool-lightbox.min.css\");\n\n__webpack_require__(/*! theme/assets/styles/main.scss */ \"./web/themes/custom/materiotheme/assets/styles/main.scss\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n_vue.default.use(_vueInfiniteLoading.default, {\n props: {\n spinner: 'spiral' // slots.noMore: ''\n\n } // system: {\n // throttleLimit: 50,\n // /* other settings need to configure */\n // }\n\n}); // import vueVimeoPlayer from 'vue-vimeo-player'\n// Vue.use(vueVimeoPlayer)\n// import VueYouTubeEmbed from 'vue-youtube-embed'\n// Vue.use(VueYouTubeEmbed)\n\n\n_vue.default.use(_vueCoolLightbox.default);\n\n_vue.default.use(_vueJsModal.default);\n\n_vue.default.use(_vueMeta.default);\n\n(function (Drupal, drupalSettings, drupalDecoupled) {\n var MaterioTheme = function MaterioTheme() {\n var _v_sitebranding_block, _v_user_block, _v_header_menu, _v_pagetitle_block, _v_search_block, _v_main_content, _v_left_content;\n\n var _is_front = drupalSettings.path.isFront;\n console.log('drupalSettings', drupalSettings); // let _I18n\n // ___ _ _\n // |_ _|_ _ (_) |_\n // | || ' \\| | _|\n // |___|_||_|_|\\__|\n\n function init() {\n console.log('MaterioTheme init()');\n initVues();\n }\n\n function checkNoVuePages() {\n // return drupalDecoupled.sys_path != '/cart'\n // && drupalDecoupled.sys_path.indexOf('checkout') != 1;\n if (drupalDecoupled.route_name.indexOf('commerce') == -1 && drupalDecoupled.route_name.indexOf('flagging_collection') == -1 && drupalDecoupled.route_name.indexOf('user') == -1) {\n return false;\n } else {\n return true;\n }\n }\n\n function initVues() {\n // only launch views if we are not in commerce pages\n if (!checkNoVuePages()) {\n initVi18n();\n initVStore();\n initVRouter();\n initVSiteBrandingBlock();\n initVPagetitleBlock();\n initVHeaderMenu();\n initVMainContent();\n initVSearchBlock();\n initVLeftContent();\n }\n\n initVUserBlock();\n }\n\n function initVi18n() {\n // i18n.locale = drupalDecoupled.lang_code\n // console.log('i18n.messages', i18n.messages)\n (0, _i18n.loadLanguageAsync)(drupalDecoupled.lang_code).then(function () {\n console.log('main.js language loaded');\n });\n }\n\n function initVStore() {\n _store.default.dispatch('Showrooms/getItems');\n }\n\n function initVRouter() {\n // we need this to update the title and body classes while using history nav\n _route.default.beforeEach(function (to, from, next) {\n var _document$querySelect, _document$querySelect2;\n\n // console.log('router beforeEach to ', to);\n // commit new title to store\n var title = null;\n\n switch (to.name) {\n case 'home':\n title = null;\n break;\n\n case 'article':\n title = false;\n break;\n\n default:\n title = to.name;\n }\n\n if (title !== false) {\n _store.default.commit('Common/setPagetitle', title);\n } // remove all path related body classes\n\n\n var body_classes = document.querySelector('body').classList;\n var classes_to_rm = [];\n\n for (var i = 0; i < body_classes.length; i++) {\n if (body_classes[i].startsWith('path-')) {\n classes_to_rm.push(body_classes[i]);\n }\n }\n\n (_document$querySelect = document.querySelector('body').classList).remove.apply(_document$querySelect, classes_to_rm); // add new path classes to body\n\n\n var classes = [];\n\n if (to.path == '/') {\n classes.push('path-home');\n } else {\n var path_parts = to.path.replace(/^\\//, '').split('/'); // TODO: remove language relative prefix from path classes (fr, en, etc)\n\n for (var i = 0; i < path_parts.length; i++) {\n if (i == 0) {\n var c = 'path-' + path_parts[i];\n } else if (path_parts[i] !== '') {\n var c = classes[i - 1] + '-' + path_parts[i];\n }\n\n classes.push(c);\n }\n }\n\n (_document$querySelect2 = document.querySelector('body').classList).add.apply(_document$querySelect2, classes); // trigger router\n\n\n next();\n });\n }\n\n function initVSiteBrandingBlock() {\n _v_sitebranding_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n router: _route.default,\n el: '#block-sitebranding',\n methods: {\n onclick: function onclick(event) {\n // console.log(\"Clicked on logo event\", event);\n var href = event.target.getAttribute('href'); // console.log(\"Clicked on logo href\", href);\n\n this.$router.push(href); // replaced by router.beforeEach\n // this.$store.commit('Common/setPagetitle', null)\n }\n }\n });\n }\n\n function initVPagetitleBlock() {\n var $blk = document.querySelector('#block-pagetitle');\n var $h2 = $blk.querySelector('h2'); // get the loaded pagetitle\n\n var title = $h2.innerText; // if not front recorde the loaded pagetitle in store\n\n if (!_is_front) {\n _store.default.commit('Common/setPagetitle', title);\n } // replace in template the pagetitle by vue binding\n\n\n $h2.innerText = '{{ pagetitle }}'; // create the vue\n\n _v_pagetitle_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n router: _route.default,\n el: $blk,\n computed: _objectSpread({}, (0, _vuex.mapState)({\n pagetitle: function pagetitle(state) {\n return state.Common.pagetitle;\n }\n }))\n });\n }\n\n function initVUserBlock() {\n var mount_point = drupalSettings.user.uid !== 0 ? 'block-userblock' : 'block-userlogin';\n var props = {\n title: '',\n loginblock: ''\n };\n var $block;\n\n switch (mount_point) {\n case 'block-userlogin':\n $block = document.getElementById(mount_point);\n console.log('initVUserBlock login form html', $block);\n props.loginblock = $block.outerHTML.trim();\n break;\n\n case 'block-userblock':\n default:\n break;\n }\n\n _v_user_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n // computed: {\n // ...mapState({\n // isloggedin: state => state.User.isloggedin\n // })\n // },\n created: function created() {\n // if already loggedin, call store.user to get the user infos\n if (drupalSettings.user.uid !== 0) {\n this.$store.commit('User/setUid', drupalSettings.user.uid);\n this.$store.dispatch('User/getUser');\n }\n },\n render: function render(h) {\n return h(_UserBlock.default, {\n props: props\n });\n }\n }).$mount('#' + mount_point); // console.log('initVUserBlock', _v_user_block);\n }\n\n function initVHeaderMenu() {\n // console.log('initVHeaderMenu');\n // adding vuejs attributes has it wont work on twig template (see menu--header.html.twig)\n // not working : String contains an invalid character\n // document.querySelectorAll(`#block-header a`).forEach(link => {\n // console.log(link);\n // link.setAttribute('@click.prevent', 'onclick')\n // });\n _v_header_menu = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n router: _route.default,\n el: '#block-header',\n methods: {\n onclick: function onclick(event) {\n // console.log(\"Clicked on header menu link\", event);\n var href = event.target.getAttribute('href'); // let title = event.target.innerText;\n // console.log(\"Clicked on header menu link : href\", href);\n\n this.$router.push(href); // replaced by router.beforeEach\n // this.$store.commit('Common/setPagetitle', title)\n }\n }\n });\n }\n\n function initVMainContent() {\n var id = 'main-content';\n var $main_content = document.querySelector('#' + id); // console.log('main-content', $main_content);\n\n var main_html = $main_content.innerHTML;\n _v_main_content = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n metaInfo: {\n // if no subcomponents specify a metaInfo.title, this title will be used\n title: \"materiO'\",\n // all titles will be injected into this template\n titleTemplate: \"%s | materiO'\"\n },\n render: function render(h) {\n return h(_MainContent.default, {\n props: {\n id: id,\n html: main_html,\n isfront: drupalSettings.path.isFront\n }\n });\n }\n }).$mount('#' + id);\n }\n\n function initVSearchBlock() {\n // console.log('initVSearchBlock');\n var id = 'block-materiosapisearchblock';\n var $search_block = document.getElementById(id);\n var formhtml = null;\n\n if ($search_block) {\n // get the search form html to pass it as template to the vue\n // we gain display speed vs async downloaded data\n formhtml = $search_block.innerHTML;\n } else {\n // else create the empty block to fill it later with async data\n $search_block = document.createElement('div');\n $search_block.setAttribute('id', id); // TODO: get region by REST\n\n var $region = document.getElementById('header-bottom');\n $region.appendChild($search_block);\n } // in any case create the vue\n\n\n _v_search_block = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n render: function render(h) {\n return h(_SearchBlock.default, {\n props: {\n blockid: id,\n formhtml: formhtml\n }\n });\n }\n }).$mount('#' + id);\n }\n\n function initVLeftContent() {\n var id = 'content-left';\n var $leftContent = document.getElementById(id); // in any case create the vue\n\n _v_left_content = new _vue.default({\n store: _store.default,\n i18n: _i18n.i18n,\n render: function render(h) {\n return h(_LeftContent.default, {\n props: {\n id: id\n }\n });\n }\n }).$mount('#' + id);\n }\n\n init();\n }; // end MaterioTheme()\n\n\n var materiotheme = new MaterioTheme();\n})(Drupal, drupalSettings, drupalDecoupled);\n\n//# sourceURL=webpack://materio.com/./web/themes/custom/materiotheme/assets/scripts/main.js?"); })(); /******/ })() diff --git a/web/themes/custom/materiotheme/assets/scripts/main.js b/web/themes/custom/materiotheme/assets/scripts/main.js index ba14adc..23a06f4 100644 --- a/web/themes/custom/materiotheme/assets/scripts/main.js +++ b/web/themes/custom/materiotheme/assets/scripts/main.js @@ -31,6 +31,9 @@ import router from 'vuejs/route' // import * as Locales from 'assets/i18n/locales.json' import { i18n, loadLanguageAsync } from 'vuejs/i18n' +import VueMeta from 'vue-meta' +Vue.use(VueMeta) + import VUserBlock from 'vuejs/components/Block/UserBlock' import VMainContent from 'vuejs/components/Content/MainContent' import VSearchBlock from 'vuejs/components/Block/SearchBlock' @@ -273,6 +276,12 @@ import 'theme/assets/styles/main.scss' _v_main_content = new Vue({ store, i18n, + metaInfo: { + // if no subcomponents specify a metaInfo.title, this title will be used + title: "materiO'", + // all titles will be injected into this template + titleTemplate: "%s | materiO'" + }, render: h => h(VMainContent, { props: { id: id, html: main_html, isfront: drupalSettings.path.isFront } }) }).$mount('#' + id) } diff --git a/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue b/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue index e1b66f9..417e76c 100644 --- a/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue +++ b/web/themes/custom/materiotheme/vuejs/components/Pages/Article.vue @@ -7,18 +7,18 @@ @@ -95,18 +95,18 @@ @@ -142,13 +142,18 @@ export default { prevnext:{}, nid:null, path: null, - article:null, + article:{}, image_accroche: null, lightbox_items: null, loading:true, lightbox_index:null, } }, + metaInfo () { + return { + title: this.article.title + } + }, computed: { ...mapState({ items: state => state.Blabla.items @@ -187,17 +192,6 @@ export default { if(this.path){ this.loadArticle() - // get the prev next items - if(!this.items.length){ - // if items list not yet loaded preload them - this.getItems().then(() => { - // then get the index - this.getIndex() - }) - }else{ - // or directly get the index - this.getIndex() - } }else{ // if for any reason we dont have the uuid // redirect to home @@ -205,10 +199,10 @@ export default { } }, getIndex(){ - console.log("Article getIndex"); - this.getItemIndex(this.nid).then((index) => { + console.log("Article getIndex article.id:", this.article.id); + this.getItemIndex(this.article.id).then((index) => { this.index = index - // console.log('article index', index, this); + console.log('article index', index, this); this.getPrevNextItems(index).then((pn) => { this.prevnext = pn }) @@ -218,13 +212,6 @@ export default { console.log('loadArticle') this.loading = true - // let ast = gql`{ - // article(id: ${this.nid}) { - // ...ArticleFields - // } - // } - // ${ articleFields } - // ` let ast = gql`{ route(path: "${this.path}") { ...ArticleFields @@ -232,7 +219,6 @@ export default { } ${ articleFields } ` - MGQ.post('', { query: print(ast) }) .then(({ data:{data:{route}}}) => { @@ -248,6 +234,18 @@ export default { console.log('parseDataGQL article', article) this.article = article + // get the prev next items + if(!this.items.length){ + // if items list not yet loaded preload them + this.getItems().then(() => { + // then get the index + this.getIndex() + }) + }else{ + // or directly get the index + this.getIndex() + } + this.image_accroche = article.images[0] this.lightbox_items = []; @@ -296,24 +294,34 @@ export default { this.loading = false; }, - onNext(){ + onPrevNext(a){ // console.log('clicked on next', this.prevnext.next); - let alias = this.prevnext.next.view_node.replace(/^.?\/blabla\//g, '') + // let alias = this.prevnext.next.view_node.replace(/^.?\/blabla\//g, '') + let alias = a.replace(/^.?\/blabla\//g, '') this.$router.push({ name:`article`, - params: { alias:alias }, - query: { uuid: this.prevnext.next.uuid } - }) - }, - onPrev(){ - // console.log('clicked on prev', this.prevnext.next); - let alias = this.prevnext.prev.view_node.replace(/^.?\/blabla\//g, '') - this.$router.push({ - name:`article`, - params: { alias:alias }, - query: { uuid: this.prevnext.prev.uuid } + params: { alias:alias } + // query: { uuid: this.prevnext.next.uuid } }) }, + // onNext(){ + // // console.log('clicked on next', this.prevnext.next); + // let alias = this.prevnext.next.view_node.replace(/^.?\/blabla\//g, '') + // this.$router.push({ + // name:`article`, + // params: { alias:alias } + // // query: { uuid: this.prevnext.next.uuid } + // }) + // }, + // onPrev(){ + // // console.log('clicked on prev', this.prevnext.next); + // let alias = this.prevnext.prev.view_node.replace(/^.?\/blabla\//g, '') + // this.$router.push({ + // name:`article`, + // params: { alias:alias } + // // query: { uuid: this.prevnext.prev.uuid } + // }) + // }, setLightboxIndex(index) { this.lightbox_index = index } diff --git a/web/themes/custom/materiotheme/vuejs/store/modules/blabla.js b/web/themes/custom/materiotheme/vuejs/store/modules/blabla.js index c69a6c9..24402a0 100644 --- a/web/themes/custom/materiotheme/vuejs/store/modules/blabla.js +++ b/web/themes/custom/materiotheme/vuejs/store/modules/blabla.js @@ -68,11 +68,14 @@ export default { dispatch('getItems') }, getItemIndex ({ dispatch, commit, state }, nid) { + console.log('getItemIndex nid', nid) return state.items.findIndex((e) => { - return e.nid == nid + // console.log('findIndex', e, nid); + return e.nid === nid }) }, getPrevNextItems ({ dispatch, commit, state }, index) { + // TODO: preload prev and next items return { prev: state.items[index - 1], next: state.items[index + 1]