From 073772c0478a088673b2b1f1870909b4370ca87f Mon Sep 17 00:00:00 2001 From: Peter Savchenko Date: Thu, 4 Oct 2018 22:08:21 +0300 Subject: [PATCH] Page creation basics (#7) * Page cration basics * remove unused code * add client-side Header validation * remove static method * rm await duplication --- package.json | 1 + public/dist/editor.bundle.js | 27 ++- public/dist/main.bundle.js | 4 +- public/dist/main.css | 2 +- src/controllers/pages.js | 42 ++++- src/frontend/js/classes/editor.js | 37 +++- src/frontend/js/modules/writing.js | 98 ++++++++++- src/frontend/styles/components/writing.pcss | 20 +++ src/frontend/styles/layout.pcss | 2 +- src/frontend/styles/main.pcss | 1 + src/frontend/styles/vars.pcss | 1 + src/models/page.js | 14 +- src/routes/pages.js | 6 +- src/views/pages/form.twig | 19 +++ test/models/page.js | 178 ++++++++++++++++---- test/rest/pages.js | 113 +++++++++---- yarn.lock | 4 + 17 files changed, 476 insertions(+), 93 deletions(-) create mode 100644 src/frontend/styles/components/writing.pcss diff --git a/package.json b/package.json index 71a6b57..dbde531 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@babel/polyfill": "^7.0.0", "body-parser": "latest", "codex.editor": "^2.0.11", + "codex.editor.header": "^2.0.5", "cookie-parser": "~1.4.3", "debug": "~2.6.9", "express": "~4.16.0", diff --git a/public/dist/editor.bundle.js b/public/dist/editor.bundle.js index a3e6ecb..0c2964b 100644 --- a/public/dist/editor.bundle.js +++ b/public/dist/editor.bundle.js @@ -26,7 +26,7 @@ /*!*********************************************************************************!*\ !*** ./node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js ***! \*********************************************************************************/ -/*! no static exports found */function(e,o,t){(function(o){!function(o){"use strict";var t,s=Object.prototype,n=s.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},l=r.iterator||"@@iterator",u=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag",d="object"==typeof e,c=o.regeneratorRuntime;if(c)d&&(e.exports=c);else{(c=o.regeneratorRuntime=d?e.exports:{}).wrap=y;var a="suspendedStart",m="suspendedYield",f="executing",j="completed",_={},p={};p[l]=function(){return this};var h=Object.getPrototypeOf,b=h&&h(h(N([])));b&&b!==s&&n.call(b,l)&&(p=b);var v=w.prototype=k.prototype=Object.create(p);x.prototype=v.constructor=w,w.constructor=x,w[i]=x.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var o="function"==typeof e&&e.constructor;return!!o&&(o===x||"GeneratorFunction"===(o.displayName||o.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,i in e||(e[i]="GeneratorFunction")),e.prototype=Object.create(v),e},c.awrap=function(e){return{__await:e}},S(E.prototype),E.prototype[u]=function(){return this},c.AsyncIterator=E,c.async=function(e,o,t,s){var n=new E(y(e,o,t,s));return c.isGeneratorFunction(o)?n:n.next().then(function(e){return e.done?e.value:n.next()})},S(v),v[i]="Generator",v[l]=function(){return this},v.toString=function(){return"[object Generator]"},c.keys=function(e){var o=[];for(var t in e)o.push(t);return o.reverse(),function t(){for(;o.length;){var s=o.pop();if(s in e)return t.value=s,t.done=!1,t}return t.done=!0,t}},c.values=N,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var o in this)"t"===o.charAt(0)&&n.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var o=this;function s(s,n){return u.type="throw",u.arg=e,o.next=s,n&&(o.method="next",o.arg=t),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var l=this.tryEntries[r],u=l.completion;if("root"===l.tryLoc)return s("end");if(l.tryLoc<=this.prev){var i=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(i&&d){if(this.prev=0;--t){var s=this.tryEntries[t];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--o){var t=this.tryEntries[o];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),M(t),_}},catch:function(e){for(var o=this.tryEntries.length-1;o>=0;--o){var t=this.tryEntries[o];if(t.tryLoc===e){var s=t.completion;if("throw"===s.type){var n=s.arg;M(t)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,o,s){return this.delegate={iterator:N(e),resultName:o,nextLoc:s},"next"===this.method&&(this.arg=t),_}}}function y(e,o,t,s){var n=o&&o.prototype instanceof k?o:k,r=Object.create(n.prototype),l=new O(s||[]);return r._invoke=function(e,o,t){var s=a;return function(n,r){if(s===f)throw new Error("Generator is already running");if(s===j){if("throw"===n)throw r;return B()}for(t.method=n,t.arg=r;;){var l=t.delegate;if(l){var u=C(l,t);if(u){if(u===_)continue;return u}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(s===a)throw s=j,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);s=f;var i=g(e,o,t);if("normal"===i.type){if(s=t.done?j:m,i.arg===_)continue;return{value:i.arg,done:t.done}}"throw"===i.type&&(s=j,t.method="throw",t.arg=i.arg)}}}(e,t,l),r}function g(e,o,t){try{return{type:"normal",arg:e.call(o,t)}}catch(e){return{type:"throw",arg:e}}}function k(){}function x(){}function w(){}function S(e){["next","throw","return"].forEach(function(o){e[o]=function(e){return this._invoke(o,e)}})}function E(e){function t(o,s,r,l){var u=g(e[o],e,s);if("throw"!==u.type){var i=u.arg,d=i.value;return d&&"object"==typeof d&&n.call(d,"__await")?Promise.resolve(d.__await).then(function(e){t("next",e,r,l)},function(e){t("throw",e,r,l)}):Promise.resolve(d).then(function(e){i.value=e,r(i)},l)}l(u.arg)}var s;"object"==typeof o.process&&o.process.domain&&(t=o.process.domain.bind(t)),this._invoke=function(e,o){function n(){return new Promise(function(s,n){t(e,o,s,n)})}return s=s?s.then(n,n):n()}}function C(e,o){var s=e.iterator[o.method];if(s===t){if(o.delegate=null,"throw"===o.method){if(e.iterator.return&&(o.method="return",o.arg=t,C(e,o),"throw"===o.method))return _;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=g(s,e.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,_;var r=n.arg;return r?r.done?(o[e.resultName]=r.value,o.next=e.nextLoc,"return"!==o.method&&(o.method="next",o.arg=t),o.delegate=null,_):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,_)}function T(e){var o={tryLoc:e[0]};1 in e&&(o.catchLoc=e[1]),2 in e&&(o.finallyLoc=e[2],o.afterLoc=e[3]),this.tryEntries.push(o)}function M(e){var o=e.completion||{};o.type="normal",delete o.arg,e.completion=o}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(e){if(e){var o=e[l];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,r=function o(){for(;++s=0;--r){var l=this.tryEntries[r],u=l.completion;if("root"===l.tryLoc)return s("end");if(l.tryLoc<=this.prev){var i=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(i&&d){if(this.prev=0;--t){var s=this.tryEntries[t];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--o){var t=this.tryEntries[o];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),M(t),_}},catch:function(e){for(var o=this.tryEntries.length-1;o>=0;--o){var t=this.tryEntries[o];if(t.tryLoc===e){var s=t.completion;if("throw"===s.type){var n=s.arg;M(t)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,o,s){return this.delegate={iterator:B(e),resultName:o,nextLoc:s},"next"===this.method&&(this.arg=t),_}}}function y(e,o,t,s){var n=o&&o.prototype instanceof k?o:k,r=Object.create(n.prototype),l=new O(s||[]);return r._invoke=function(e,o,t){var s=a;return function(n,r){if(s===f)throw new Error("Generator is already running");if(s===j){if("throw"===n)throw r;return N()}for(t.method=n,t.arg=r;;){var l=t.delegate;if(l){var u=C(l,t);if(u){if(u===_)continue;return u}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(s===a)throw s=j,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);s=f;var i=g(e,o,t);if("normal"===i.type){if(s=t.done?j:m,i.arg===_)continue;return{value:i.arg,done:t.done}}"throw"===i.type&&(s=j,t.method="throw",t.arg=i.arg)}}}(e,t,l),r}function g(e,o,t){try{return{type:"normal",arg:e.call(o,t)}}catch(e){return{type:"throw",arg:e}}}function k(){}function x(){}function w(){}function S(e){["next","throw","return"].forEach(function(o){e[o]=function(e){return this._invoke(o,e)}})}function E(e){function t(o,s,r,l){var u=g(e[o],e,s);if("throw"!==u.type){var i=u.arg,d=i.value;return d&&"object"==typeof d&&n.call(d,"__await")?Promise.resolve(d.__await).then(function(e){t("next",e,r,l)},function(e){t("throw",e,r,l)}):Promise.resolve(d).then(function(e){i.value=e,r(i)},l)}l(u.arg)}var s;"object"==typeof o.process&&o.process.domain&&(t=o.process.domain.bind(t)),this._invoke=function(e,o){function n(){return new Promise(function(s,n){t(e,o,s,n)})}return s=s?s.then(n,n):n()}}function C(e,o){var s=e.iterator[o.method];if(s===t){if(o.delegate=null,"throw"===o.method){if(e.iterator.return&&(o.method="return",o.arg=t,C(e,o),"throw"===o.method))return _;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=g(s,e.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,_;var r=n.arg;return r?r.done?(o[e.resultName]=r.value,o.next=e.nextLoc,"return"!==o.method&&(o.method="next",o.arg=t),o.delegate=null,_):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,_)}function T(e){var o={tryLoc:e[0]};1 in e&&(o.catchLoc=e[1]),2 in e&&(o.finallyLoc=e[2],o.afterLoc=e[3]),this.tryEntries.push(o)}function M(e){var o=e.completion||{};o.type="normal",delete o.arg,e.completion=o}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(e){if(e){var o=e[l];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,r=function o(){for(;++sr;)l(t[r++]);e._c=[],e._n=!1,o&&!e._h&&A(e)})}},A=function(e){h.call(i,function(){var o,t,s,n=e._v,r=P(e);if(r&&(o=y(function(){T?w.emit("unhandledRejection",n,e):(t=i.onunhandledrejection)?t({promise:e,reason:n}):(s=i.console)&&s.error&&s.error("Unhandled promise rejection",n)}),e._h=T||P(e)?2:1),e._a=void 0,r&&o.e)throw o.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},L=function(e){h.call(i,function(){var o;T?w.emit("rejectionHandled",e):(o=i.onrejectionhandled)&&o({promise:e,reason:e._v})})},R=function(e){var o=this;o._d||(o._d=!0,(o=o._w||o)._v=e,o._s=2,o._a||(o._a=o._c.slice()),I(o,!0))},F=function(e){var o,t=this;if(!t._d){t._d=!0,t=t._w||t;try{if(t===e)throw x("Promise can't be resolved itself");(o=B(e))?b(function(){var s={_w:t,_d:!1};try{o.call(e,d(F,s,1),d(R,s,1))}catch(e){R.call(s,e)}}):(t._v=e,t._s=1,I(t,!1))}catch(e){R.call({_w:t,_d:!1},e)}}};N||(C=function(e){j(this,C,"Promise","_h"),f(e),s.call(this);try{e(d(F,this,1),d(R,this,1))}catch(e){R.call(this,e)}},(s=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=t(/*! ./_redefine-all */"./node_modules/core-js/library/modules/_redefine-all.js")(C.prototype,{then:function(e,o){var t=O(p(this,C));return t.ok="function"!=typeof e||e,t.fail="function"==typeof o&&o,t.domain=T?w.domain:void 0,this._c.push(t),this._a&&this._a.push(t),this._s&&I(this,!1),t.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new s;this.promise=e,this.resolve=d(F,e,1),this.reject=d(R,e,1)},v.f=O=function(e){return e===C||e===l?new r(e):n(e)}),a(a.G+a.W+a.F*!N,{Promise:C}),t(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js")(C,"Promise"),t(/*! ./_set-species */"./node_modules/core-js/library/modules/_set-species.js")("Promise"),l=t(/*! ./_core */"./node_modules/core-js/library/modules/_core.js").Promise,a(a.S+a.F*!N,"Promise",{reject:function(e){var o=O(this);return(0,o.reject)(e),o.promise}}),a(a.S+a.F*(u||!N),"Promise",{resolve:function(e){return k(u&&this===l?C:this,e)}}),a(a.S+a.F*!(N&&t(/*! ./_iter-detect */"./node_modules/core-js/library/modules/_iter-detect.js")(function(e){C.all(e).catch(M)})),"Promise",{all:function(e){var o=this,t=O(o),s=t.resolve,n=t.reject,r=y(function(){var t=[],r=0,l=1;_(e,!1,function(e){var u=r++,i=!1;t.push(void 0),l++,o.resolve(e).then(function(e){i||(i=!0,t[u]=e,--l||s(t))},n)}),--l||s(t)});return r.e&&n(r.v),t.promise},race:function(e){var o=this,t=O(o),s=t.reject,n=y(function(){_(e,!1,function(e){o.resolve(e).then(t.resolve,s)})});return n.e&&s(n.v),t.promise}})},"./node_modules/core-js/library/modules/es6.string.iterator.js": +/*! no static exports found */function(e,o,t){"use strict";var s,n,r,l,u=t(/*! ./_library */"./node_modules/core-js/library/modules/_library.js"),i=t(/*! ./_global */"./node_modules/core-js/library/modules/_global.js"),d=t(/*! ./_ctx */"./node_modules/core-js/library/modules/_ctx.js"),c=t(/*! ./_classof */"./node_modules/core-js/library/modules/_classof.js"),a=t(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),m=t(/*! ./_is-object */"./node_modules/core-js/library/modules/_is-object.js"),f=t(/*! ./_a-function */"./node_modules/core-js/library/modules/_a-function.js"),j=t(/*! ./_an-instance */"./node_modules/core-js/library/modules/_an-instance.js"),_=t(/*! ./_for-of */"./node_modules/core-js/library/modules/_for-of.js"),p=t(/*! ./_species-constructor */"./node_modules/core-js/library/modules/_species-constructor.js"),h=t(/*! ./_task */"./node_modules/core-js/library/modules/_task.js").set,b=t(/*! ./_microtask */"./node_modules/core-js/library/modules/_microtask.js")(),v=t(/*! ./_new-promise-capability */"./node_modules/core-js/library/modules/_new-promise-capability.js"),y=t(/*! ./_perform */"./node_modules/core-js/library/modules/_perform.js"),g=t(/*! ./_user-agent */"./node_modules/core-js/library/modules/_user-agent.js"),k=t(/*! ./_promise-resolve */"./node_modules/core-js/library/modules/_promise-resolve.js"),x=i.TypeError,w=i.process,S=w&&w.versions,E=S&&S.v8||"",C=i.Promise,T="process"==c(w),M=function(){},O=n=v.f,B=!!function(){try{var e=C.resolve(1),o=(e.constructor={})[t(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js")("species")]=function(e){e(M,M)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(M)instanceof o&&0!==E.indexOf("6.6")&&-1===g.indexOf("Chrome/66")}catch(e){}}(),N=function(e){var o;return!(!m(e)||"function"!=typeof(o=e.then))&&o},A=function(e,o){if(!e._n){e._n=!0;var t=e._c;b(function(){for(var s=e._v,n=1==e._s,r=0,l=function(o){var t,r,l,u=n?o.ok:o.fail,i=o.resolve,d=o.reject,c=o.domain;try{u?(n||(2==e._h&&P(e),e._h=1),!0===u?t=s:(c&&c.enter(),t=u(s),c&&(c.exit(),l=!0)),t===o.promise?d(x("Promise-chain cycle")):(r=N(t))?r.call(t,i,d):i(t)):d(s)}catch(e){c&&!l&&c.exit(),d(e)}};t.length>r;)l(t[r++]);e._c=[],e._n=!1,o&&!e._h&&I(e)})}},I=function(e){h.call(i,function(){var o,t,s,n=e._v,r=L(e);if(r&&(o=y(function(){T?w.emit("unhandledRejection",n,e):(t=i.onunhandledrejection)?t({promise:e,reason:n}):(s=i.console)&&s.error&&s.error("Unhandled promise rejection",n)}),e._h=T||L(e)?2:1),e._a=void 0,r&&o.e)throw o.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},P=function(e){h.call(i,function(){var o;T?w.emit("rejectionHandled",e):(o=i.onrejectionhandled)&&o({promise:e,reason:e._v})})},R=function(e){var o=this;o._d||(o._d=!0,(o=o._w||o)._v=e,o._s=2,o._a||(o._a=o._c.slice()),A(o,!0))},F=function(e){var o,t=this;if(!t._d){t._d=!0,t=t._w||t;try{if(t===e)throw x("Promise can't be resolved itself");(o=N(e))?b(function(){var s={_w:t,_d:!1};try{o.call(e,d(F,s,1),d(R,s,1))}catch(e){R.call(s,e)}}):(t._v=e,t._s=1,A(t,!1))}catch(e){R.call({_w:t,_d:!1},e)}}};B||(C=function(e){j(this,C,"Promise","_h"),f(e),s.call(this);try{e(d(F,this,1),d(R,this,1))}catch(e){R.call(this,e)}},(s=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=t(/*! ./_redefine-all */"./node_modules/core-js/library/modules/_redefine-all.js")(C.prototype,{then:function(e,o){var t=O(p(this,C));return t.ok="function"!=typeof e||e,t.fail="function"==typeof o&&o,t.domain=T?w.domain:void 0,this._c.push(t),this._a&&this._a.push(t),this._s&&A(this,!1),t.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new s;this.promise=e,this.resolve=d(F,e,1),this.reject=d(R,e,1)},v.f=O=function(e){return e===C||e===l?new r(e):n(e)}),a(a.G+a.W+a.F*!B,{Promise:C}),t(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js")(C,"Promise"),t(/*! ./_set-species */"./node_modules/core-js/library/modules/_set-species.js")("Promise"),l=t(/*! ./_core */"./node_modules/core-js/library/modules/_core.js").Promise,a(a.S+a.F*!B,"Promise",{reject:function(e){var o=O(this);return(0,o.reject)(e),o.promise}}),a(a.S+a.F*(u||!B),"Promise",{resolve:function(e){return k(u&&this===l?C:this,e)}}),a(a.S+a.F*!(B&&t(/*! ./_iter-detect */"./node_modules/core-js/library/modules/_iter-detect.js")(function(e){C.all(e).catch(M)})),"Promise",{all:function(e){var o=this,t=O(o),s=t.resolve,n=t.reject,r=y(function(){var t=[],r=0,l=1;_(e,!1,function(e){var u=r++,i=!1;t.push(void 0),l++,o.resolve(e).then(function(e){i||(i=!0,t[u]=e,--l||s(t))},n)}),--l||s(t)});return r.e&&n(r.v),t.promise},race:function(e){var o=this,t=O(o),s=t.reject,n=y(function(){_(e,!1,function(e){o.resolve(e).then(t.resolve,s)})});return n.e&&s(n.v),t.promise}})},"./node_modules/core-js/library/modules/es6.string.iterator.js": /*!*********************************************************************!*\ !*** ./node_modules/core-js/library/modules/es6.string.iterator.js ***! \*********************************************************************/ @@ -590,7 +590,7 @@ /*!************************************************************!*\ !*** ./node_modules/core-js/library/modules/es6.symbol.js ***! \************************************************************/ -/*! no static exports found */function(e,o,t){"use strict";var s=t(/*! ./_global */"./node_modules/core-js/library/modules/_global.js"),n=t(/*! ./_has */"./node_modules/core-js/library/modules/_has.js"),r=t(/*! ./_descriptors */"./node_modules/core-js/library/modules/_descriptors.js"),l=t(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),u=t(/*! ./_redefine */"./node_modules/core-js/library/modules/_redefine.js"),i=t(/*! ./_meta */"./node_modules/core-js/library/modules/_meta.js").KEY,d=t(/*! ./_fails */"./node_modules/core-js/library/modules/_fails.js"),c=t(/*! ./_shared */"./node_modules/core-js/library/modules/_shared.js"),a=t(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js"),m=t(/*! ./_uid */"./node_modules/core-js/library/modules/_uid.js"),f=t(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js"),j=t(/*! ./_wks-ext */"./node_modules/core-js/library/modules/_wks-ext.js"),_=t(/*! ./_wks-define */"./node_modules/core-js/library/modules/_wks-define.js"),p=t(/*! ./_enum-keys */"./node_modules/core-js/library/modules/_enum-keys.js"),h=t(/*! ./_is-array */"./node_modules/core-js/library/modules/_is-array.js"),b=t(/*! ./_an-object */"./node_modules/core-js/library/modules/_an-object.js"),v=t(/*! ./_is-object */"./node_modules/core-js/library/modules/_is-object.js"),y=t(/*! ./_to-iobject */"./node_modules/core-js/library/modules/_to-iobject.js"),g=t(/*! ./_to-primitive */"./node_modules/core-js/library/modules/_to-primitive.js"),k=t(/*! ./_property-desc */"./node_modules/core-js/library/modules/_property-desc.js"),x=t(/*! ./_object-create */"./node_modules/core-js/library/modules/_object-create.js"),w=t(/*! ./_object-gopn-ext */"./node_modules/core-js/library/modules/_object-gopn-ext.js"),S=t(/*! ./_object-gopd */"./node_modules/core-js/library/modules/_object-gopd.js"),E=t(/*! ./_object-dp */"./node_modules/core-js/library/modules/_object-dp.js"),C=t(/*! ./_object-keys */"./node_modules/core-js/library/modules/_object-keys.js"),T=S.f,M=E.f,O=w.f,N=s.Symbol,B=s.JSON,I=B&&B.stringify,A=f("_hidden"),P=f("toPrimitive"),L={}.propertyIsEnumerable,R=c("symbol-registry"),F=c("symbols"),D=c("op-symbols"),U=Object.prototype,z="function"==typeof N,H=s.QObject,G=!H||!H.prototype||!H.prototype.findChild,W=r&&d(function(){return 7!=x(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(e,o,t){var s=T(U,o);s&&delete U[o],M(e,o,t),s&&e!==U&&M(U,o,s)}:M,V=function(e){var o=F[e]=x(N.prototype);return o._k=e,o},K=z&&"symbol"==typeof N.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof N},q=function(e,o,t){return e===U&&q(D,o,t),b(e),o=g(o,!0),b(t),n(F,o)?(t.enumerable?(n(e,A)&&e[A][o]&&(e[A][o]=!1),t=x(t,{enumerable:k(0,!1)})):(n(e,A)||M(e,A,k(1,{})),e[A][o]=!0),W(e,o,t)):M(e,o,t)},Y=function(e,o){b(e);for(var t,s=p(o=y(o)),n=0,r=s.length;r>n;)q(e,t=s[n++],o[t]);return e},J=function(e){var o=L.call(this,e=g(e,!0));return!(this===U&&n(F,e)&&!n(D,e))&&(!(o||!n(this,e)||!n(F,e)||n(this,A)&&this[A][e])||o)},X=function(e,o){if(e=y(e),o=g(o,!0),e!==U||!n(F,o)||n(D,o)){var t=T(e,o);return!t||!n(F,o)||n(e,A)&&e[A][o]||(t.enumerable=!0),t}},$=function(e){for(var o,t=O(y(e)),s=[],r=0;t.length>r;)n(F,o=t[r++])||o==A||o==i||s.push(o);return s},Z=function(e){for(var o,t=e===U,s=O(t?D:y(e)),r=[],l=0;s.length>l;)!n(F,o=s[l++])||t&&!n(U,o)||r.push(F[o]);return r};z||(u((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var e=m(arguments.length>0?arguments[0]:void 0),o=function(t){this===U&&o.call(D,t),n(this,A)&&n(this[A],e)&&(this[A][e]=!1),W(this,e,k(1,t))};return r&&G&&W(U,e,{configurable:!0,set:o}),V(e)}).prototype,"toString",function(){return this._k}),S.f=X,E.f=q,t(/*! ./_object-gopn */"./node_modules/core-js/library/modules/_object-gopn.js").f=w.f=$,t(/*! ./_object-pie */"./node_modules/core-js/library/modules/_object-pie.js").f=J,t(/*! ./_object-gops */"./node_modules/core-js/library/modules/_object-gops.js").f=Z,r&&!t(/*! ./_library */"./node_modules/core-js/library/modules/_library.js")&&u(U,"propertyIsEnumerable",J,!0),j.f=function(e){return V(f(e))}),l(l.G+l.W+l.F*!z,{Symbol:N});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)f(Q[ee++]);for(var oe=C(f.store),te=0;oe.length>te;)_(oe[te++]);l(l.S+l.F*!z,"Symbol",{for:function(e){return n(R,e+="")?R[e]:R[e]=N(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var o in R)if(R[o]===e)return o},useSetter:function(){G=!0},useSimple:function(){G=!1}}),l(l.S+l.F*!z,"Object",{create:function(e,o){return void 0===o?x(e):Y(x(e),o)},defineProperty:q,defineProperties:Y,getOwnPropertyDescriptor:X,getOwnPropertyNames:$,getOwnPropertySymbols:Z}),B&&l(l.S+l.F*(!z||d(function(){var e=N();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){for(var o,t,s=[e],n=1;arguments.length>n;)s.push(arguments[n++]);if(t=o=s[1],(v(o)||void 0!==e)&&!K(e))return h(o)||(o=function(e,o){if("function"==typeof t&&(o=t.call(this,e,o)),!K(o))return o}),s[1]=o,I.apply(B,s)}}),N.prototype[P]||t(/*! ./_hide */"./node_modules/core-js/library/modules/_hide.js")(N.prototype,P,N.prototype.valueOf),a(N,"Symbol"),a(Math,"Math",!0),a(s.JSON,"JSON",!0)},"./node_modules/core-js/library/modules/es7.map.from.js": +/*! no static exports found */function(e,o,t){"use strict";var s=t(/*! ./_global */"./node_modules/core-js/library/modules/_global.js"),n=t(/*! ./_has */"./node_modules/core-js/library/modules/_has.js"),r=t(/*! ./_descriptors */"./node_modules/core-js/library/modules/_descriptors.js"),l=t(/*! ./_export */"./node_modules/core-js/library/modules/_export.js"),u=t(/*! ./_redefine */"./node_modules/core-js/library/modules/_redefine.js"),i=t(/*! ./_meta */"./node_modules/core-js/library/modules/_meta.js").KEY,d=t(/*! ./_fails */"./node_modules/core-js/library/modules/_fails.js"),c=t(/*! ./_shared */"./node_modules/core-js/library/modules/_shared.js"),a=t(/*! ./_set-to-string-tag */"./node_modules/core-js/library/modules/_set-to-string-tag.js"),m=t(/*! ./_uid */"./node_modules/core-js/library/modules/_uid.js"),f=t(/*! ./_wks */"./node_modules/core-js/library/modules/_wks.js"),j=t(/*! ./_wks-ext */"./node_modules/core-js/library/modules/_wks-ext.js"),_=t(/*! ./_wks-define */"./node_modules/core-js/library/modules/_wks-define.js"),p=t(/*! ./_enum-keys */"./node_modules/core-js/library/modules/_enum-keys.js"),h=t(/*! ./_is-array */"./node_modules/core-js/library/modules/_is-array.js"),b=t(/*! ./_an-object */"./node_modules/core-js/library/modules/_an-object.js"),v=t(/*! ./_is-object */"./node_modules/core-js/library/modules/_is-object.js"),y=t(/*! ./_to-iobject */"./node_modules/core-js/library/modules/_to-iobject.js"),g=t(/*! ./_to-primitive */"./node_modules/core-js/library/modules/_to-primitive.js"),k=t(/*! ./_property-desc */"./node_modules/core-js/library/modules/_property-desc.js"),x=t(/*! ./_object-create */"./node_modules/core-js/library/modules/_object-create.js"),w=t(/*! ./_object-gopn-ext */"./node_modules/core-js/library/modules/_object-gopn-ext.js"),S=t(/*! ./_object-gopd */"./node_modules/core-js/library/modules/_object-gopd.js"),E=t(/*! ./_object-dp */"./node_modules/core-js/library/modules/_object-dp.js"),C=t(/*! ./_object-keys */"./node_modules/core-js/library/modules/_object-keys.js"),T=S.f,M=E.f,O=w.f,B=s.Symbol,N=s.JSON,A=N&&N.stringify,I=f("_hidden"),L=f("toPrimitive"),P={}.propertyIsEnumerable,R=c("symbol-registry"),F=c("symbols"),D=c("op-symbols"),U=Object.prototype,H="function"==typeof B,z=s.QObject,G=!z||!z.prototype||!z.prototype.findChild,W=r&&d(function(){return 7!=x(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(e,o,t){var s=T(U,o);s&&delete U[o],M(e,o,t),s&&e!==U&&M(U,o,s)}:M,V=function(e){var o=F[e]=x(B.prototype);return o._k=e,o},K=H&&"symbol"==typeof B.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof B},q=function(e,o,t){return e===U&&q(D,o,t),b(e),o=g(o,!0),b(t),n(F,o)?(t.enumerable?(n(e,I)&&e[I][o]&&(e[I][o]=!1),t=x(t,{enumerable:k(0,!1)})):(n(e,I)||M(e,I,k(1,{})),e[I][o]=!0),W(e,o,t)):M(e,o,t)},Y=function(e,o){b(e);for(var t,s=p(o=y(o)),n=0,r=s.length;r>n;)q(e,t=s[n++],o[t]);return e},J=function(e){var o=P.call(this,e=g(e,!0));return!(this===U&&n(F,e)&&!n(D,e))&&(!(o||!n(this,e)||!n(F,e)||n(this,I)&&this[I][e])||o)},X=function(e,o){if(e=y(e),o=g(o,!0),e!==U||!n(F,o)||n(D,o)){var t=T(e,o);return!t||!n(F,o)||n(e,I)&&e[I][o]||(t.enumerable=!0),t}},$=function(e){for(var o,t=O(y(e)),s=[],r=0;t.length>r;)n(F,o=t[r++])||o==I||o==i||s.push(o);return s},Z=function(e){for(var o,t=e===U,s=O(t?D:y(e)),r=[],l=0;s.length>l;)!n(F,o=s[l++])||t&&!n(U,o)||r.push(F[o]);return r};H||(u((B=function(){if(this instanceof B)throw TypeError("Symbol is not a constructor!");var e=m(arguments.length>0?arguments[0]:void 0),o=function(t){this===U&&o.call(D,t),n(this,I)&&n(this[I],e)&&(this[I][e]=!1),W(this,e,k(1,t))};return r&&G&&W(U,e,{configurable:!0,set:o}),V(e)}).prototype,"toString",function(){return this._k}),S.f=X,E.f=q,t(/*! ./_object-gopn */"./node_modules/core-js/library/modules/_object-gopn.js").f=w.f=$,t(/*! ./_object-pie */"./node_modules/core-js/library/modules/_object-pie.js").f=J,t(/*! ./_object-gops */"./node_modules/core-js/library/modules/_object-gops.js").f=Z,r&&!t(/*! ./_library */"./node_modules/core-js/library/modules/_library.js")&&u(U,"propertyIsEnumerable",J,!0),j.f=function(e){return V(f(e))}),l(l.G+l.W+l.F*!H,{Symbol:B});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)f(Q[ee++]);for(var oe=C(f.store),te=0;oe.length>te;)_(oe[te++]);l(l.S+l.F*!H,"Symbol",{for:function(e){return n(R,e+="")?R[e]:R[e]=B(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var o in R)if(R[o]===e)return o},useSetter:function(){G=!0},useSimple:function(){G=!1}}),l(l.S+l.F*!H,"Object",{create:function(e,o){return void 0===o?x(e):Y(x(e),o)},defineProperty:q,defineProperties:Y,getOwnPropertyDescriptor:X,getOwnPropertyNames:$,getOwnPropertySymbols:Z}),N&&l(l.S+l.F*(!H||d(function(){var e=B();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))})),"JSON",{stringify:function(e){for(var o,t,s=[e],n=1;arguments.length>n;)s.push(arguments[n++]);if(t=o=s[1],(v(o)||void 0!==e)&&!K(e))return h(o)||(o=function(e,o){if("function"==typeof t&&(o=t.call(this,e,o)),!K(o))return o}),s[1]=o,A.apply(N,s)}}),B.prototype[L]||t(/*! ./_hide */"./node_modules/core-js/library/modules/_hide.js")(B.prototype,L,B.prototype.valueOf),a(B,"Symbol"),a(Math,"Math",!0),a(s.JSON,"JSON",!0)},"./node_modules/core-js/library/modules/es7.map.from.js": /*!**************************************************************!*\ !*** ./node_modules/core-js/library/modules/es7.map.from.js ***! \**************************************************************/ @@ -1090,11 +1090,11 @@ /*!******************************************************!*\ !*** ./node_modules/core-js/modules/_typed-array.js ***! \******************************************************/ -/*! no static exports found */function(e,o,t){"use strict";if(t(/*! ./_descriptors */"./node_modules/core-js/modules/_descriptors.js")){var s=t(/*! ./_library */"./node_modules/core-js/modules/_library.js"),n=t(/*! ./_global */"./node_modules/core-js/modules/_global.js"),r=t(/*! ./_fails */"./node_modules/core-js/modules/_fails.js"),l=t(/*! ./_export */"./node_modules/core-js/modules/_export.js"),u=t(/*! ./_typed */"./node_modules/core-js/modules/_typed.js"),i=t(/*! ./_typed-buffer */"./node_modules/core-js/modules/_typed-buffer.js"),d=t(/*! ./_ctx */"./node_modules/core-js/modules/_ctx.js"),c=t(/*! ./_an-instance */"./node_modules/core-js/modules/_an-instance.js"),a=t(/*! ./_property-desc */"./node_modules/core-js/modules/_property-desc.js"),m=t(/*! ./_hide */"./node_modules/core-js/modules/_hide.js"),f=t(/*! ./_redefine-all */"./node_modules/core-js/modules/_redefine-all.js"),j=t(/*! ./_to-integer */"./node_modules/core-js/modules/_to-integer.js"),_=t(/*! ./_to-length */"./node_modules/core-js/modules/_to-length.js"),p=t(/*! ./_to-index */"./node_modules/core-js/modules/_to-index.js"),h=t(/*! ./_to-absolute-index */"./node_modules/core-js/modules/_to-absolute-index.js"),b=t(/*! ./_to-primitive */"./node_modules/core-js/modules/_to-primitive.js"),v=t(/*! ./_has */"./node_modules/core-js/modules/_has.js"),y=t(/*! ./_classof */"./node_modules/core-js/modules/_classof.js"),g=t(/*! ./_is-object */"./node_modules/core-js/modules/_is-object.js"),k=t(/*! ./_to-object */"./node_modules/core-js/modules/_to-object.js"),x=t(/*! ./_is-array-iter */"./node_modules/core-js/modules/_is-array-iter.js"),w=t(/*! ./_object-create */"./node_modules/core-js/modules/_object-create.js"),S=t(/*! ./_object-gpo */"./node_modules/core-js/modules/_object-gpo.js"),E=t(/*! ./_object-gopn */"./node_modules/core-js/modules/_object-gopn.js").f,C=t(/*! ./core.get-iterator-method */"./node_modules/core-js/modules/core.get-iterator-method.js"),T=t(/*! ./_uid */"./node_modules/core-js/modules/_uid.js"),M=t(/*! ./_wks */"./node_modules/core-js/modules/_wks.js"),O=t(/*! ./_array-methods */"./node_modules/core-js/modules/_array-methods.js"),N=t(/*! ./_array-includes */"./node_modules/core-js/modules/_array-includes.js"),B=t(/*! ./_species-constructor */"./node_modules/core-js/modules/_species-constructor.js"),I=t(/*! ./es6.array.iterator */"./node_modules/core-js/modules/es6.array.iterator.js"),A=t(/*! ./_iterators */"./node_modules/core-js/modules/_iterators.js"),P=t(/*! ./_iter-detect */"./node_modules/core-js/modules/_iter-detect.js"),L=t(/*! ./_set-species */"./node_modules/core-js/modules/_set-species.js"),R=t(/*! ./_array-fill */"./node_modules/core-js/modules/_array-fill.js"),F=t(/*! ./_array-copy-within */"./node_modules/core-js/modules/_array-copy-within.js"),D=t(/*! ./_object-dp */"./node_modules/core-js/modules/_object-dp.js"),U=t(/*! ./_object-gopd */"./node_modules/core-js/modules/_object-gopd.js"),z=D.f,H=U.f,G=n.RangeError,W=n.TypeError,V=n.Uint8Array,K=Array.prototype,q=i.ArrayBuffer,Y=i.DataView,J=O(0),X=O(2),$=O(3),Z=O(4),Q=O(5),ee=O(6),oe=N(!0),te=N(!1),se=I.values,ne=I.keys,re=I.entries,le=K.lastIndexOf,ue=K.reduce,ie=K.reduceRight,de=K.join,ce=K.sort,ae=K.slice,me=K.toString,fe=K.toLocaleString,je=M("iterator"),_e=M("toStringTag"),pe=T("typed_constructor"),he=T("def_constructor"),be=u.CONSTR,ve=u.TYPED,ye=u.VIEW,ge=O(1,function(e,o){return Ee(B(e,e[he]),o)}),ke=r(function(){return 1===new V(new Uint16Array([1]).buffer)[0]}),xe=!!V&&!!V.prototype.set&&r(function(){new V(1).set({})}),we=function(e,o){var t=j(e);if(t<0||t%o)throw G("Wrong offset!");return t},Se=function(e){if(g(e)&&ve in e)return e;throw W(e+" is not a typed array!")},Ee=function(e,o){if(!(g(e)&&pe in e))throw W("It is not a typed array constructor!");return new e(o)},Ce=function(e,o){return Te(B(e,e[he]),o)},Te=function(e,o){for(var t=0,s=o.length,n=Ee(e,s);s>t;)n[t]=o[t++];return n},Me=function(e,o,t){z(e,o,{get:function(){return this._d[t]}})},Oe=function(e){var o,t,s,n,r,l,u=k(e),i=arguments.length,c=i>1?arguments[1]:void 0,a=void 0!==c,m=C(u);if(void 0!=m&&!x(m)){for(l=m.call(u),s=[],o=0;!(r=l.next()).done;o++)s.push(r.value);u=s}for(a&&i>2&&(c=d(c,arguments[2],2)),o=0,t=_(u.length),n=Ee(this,t);t>o;o++)n[o]=a?c(u[o],o):u[o];return n},Ne=function(){for(var e=0,o=arguments.length,t=Ee(this,o);o>e;)t[e]=arguments[e++];return t},Be=!!V&&r(function(){fe.call(new V(1))}),Ie=function(){return fe.apply(Be?ae.call(Se(this)):Se(this),arguments)},Ae={copyWithin:function(e,o){return F.call(Se(this),e,o,arguments.length>2?arguments[2]:void 0)},every:function(e){return Z(Se(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return R.apply(Se(this),arguments)},filter:function(e){return Ce(this,X(Se(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Q(Se(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Se(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){J(Se(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return te(Se(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return oe(Se(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return de.apply(Se(this),arguments)},lastIndexOf:function(e){return le.apply(Se(this),arguments)},map:function(e){return ge(Se(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(Se(this),arguments)},reduceRight:function(e){return ie.apply(Se(this),arguments)},reverse:function(){for(var e,o=Se(this).length,t=Math.floor(o/2),s=0;s1?arguments[1]:void 0)},sort:function(e){return ce.call(Se(this),e)},subarray:function(e,o){var t=Se(this),s=t.length,n=h(e,s);return new(B(t,t[he]))(t.buffer,t.byteOffset+n*t.BYTES_PER_ELEMENT,_((void 0===o?s:h(o,s))-n))}},Pe=function(e,o){return Ce(this,ae.call(Se(this),e,o))},Le=function(e){Se(this);var o=we(arguments[1],1),t=this.length,s=k(e),n=_(s.length),r=0;if(n+o>t)throw G("Wrong length!");for(;r255?255:255&s),n.v[f](t*o+n.o,s,ke)}(this,t,e)},enumerable:!0})};v?(j=t(function(e,t,s,n){c(e,j,d,"_d");var r,l,u,i,a=0,f=0;if(g(t)){if(!(t instanceof q||"ArrayBuffer"==(i=y(t))||"SharedArrayBuffer"==i))return ve in t?Te(j,t):Oe.call(j,t);r=t,f=we(s,o);var h=t.byteLength;if(void 0===n){if(h%o)throw G("Wrong length!");if((l=h-f)<0)throw G("Wrong length!")}else if((l=_(n)*o)+f>h)throw G("Wrong length!");u=l/o}else u=p(t),r=new q(l=u*o);for(m(e,"_d",{b:r,o:f,l:l,e:u,v:new Y(r)});at;)n[t]=o[t++];return n},Me=function(e,o,t){H(e,o,{get:function(){return this._d[t]}})},Oe=function(e){var o,t,s,n,r,l,u=k(e),i=arguments.length,c=i>1?arguments[1]:void 0,a=void 0!==c,m=C(u);if(void 0!=m&&!x(m)){for(l=m.call(u),s=[],o=0;!(r=l.next()).done;o++)s.push(r.value);u=s}for(a&&i>2&&(c=d(c,arguments[2],2)),o=0,t=_(u.length),n=Ee(this,t);t>o;o++)n[o]=a?c(u[o],o):u[o];return n},Be=function(){for(var e=0,o=arguments.length,t=Ee(this,o);o>e;)t[e]=arguments[e++];return t},Ne=!!V&&r(function(){fe.call(new V(1))}),Ae=function(){return fe.apply(Ne?ae.call(Se(this)):Se(this),arguments)},Ie={copyWithin:function(e,o){return F.call(Se(this),e,o,arguments.length>2?arguments[2]:void 0)},every:function(e){return Z(Se(this),e,arguments.length>1?arguments[1]:void 0)},fill:function(e){return R.apply(Se(this),arguments)},filter:function(e){return Ce(this,X(Se(this),e,arguments.length>1?arguments[1]:void 0))},find:function(e){return Q(Se(this),e,arguments.length>1?arguments[1]:void 0)},findIndex:function(e){return ee(Se(this),e,arguments.length>1?arguments[1]:void 0)},forEach:function(e){J(Se(this),e,arguments.length>1?arguments[1]:void 0)},indexOf:function(e){return te(Se(this),e,arguments.length>1?arguments[1]:void 0)},includes:function(e){return oe(Se(this),e,arguments.length>1?arguments[1]:void 0)},join:function(e){return de.apply(Se(this),arguments)},lastIndexOf:function(e){return le.apply(Se(this),arguments)},map:function(e){return ge(Se(this),e,arguments.length>1?arguments[1]:void 0)},reduce:function(e){return ue.apply(Se(this),arguments)},reduceRight:function(e){return ie.apply(Se(this),arguments)},reverse:function(){for(var e,o=Se(this).length,t=Math.floor(o/2),s=0;s1?arguments[1]:void 0)},sort:function(e){return ce.call(Se(this),e)},subarray:function(e,o){var t=Se(this),s=t.length,n=h(e,s);return new(N(t,t[he]))(t.buffer,t.byteOffset+n*t.BYTES_PER_ELEMENT,_((void 0===o?s:h(o,s))-n))}},Le=function(e,o){return Ce(this,ae.call(Se(this),e,o))},Pe=function(e){Se(this);var o=we(arguments[1],1),t=this.length,s=k(e),n=_(s.length),r=0;if(n+o>t)throw G("Wrong length!");for(;r255?255:255&s),n.v[f](t*o+n.o,s,ke)}(this,t,e)},enumerable:!0})};v?(j=t(function(e,t,s,n){c(e,j,d,"_d");var r,l,u,i,a=0,f=0;if(g(t)){if(!(t instanceof q||"ArrayBuffer"==(i=y(t))||"SharedArrayBuffer"==i))return ve in t?Te(j,t):Oe.call(j,t);r=t,f=we(s,o);var h=t.byteLength;if(void 0===n){if(h%o)throw G("Wrong length!");if((l=h-f)<0)throw G("Wrong length!")}else if((l=_(n)*o)+f>h)throw G("Wrong length!");u=l/o}else u=p(t),r=new q(l=u*o);for(m(e,"_d",{b:r,o:f,l:l,e:u,v:new Y(r)});a>1,c=23===o?C(2,-24)-C(2,-77):0,a=0,m=e<0||0===e&&1/e<0?1:0;for((e=E(e))!=e||e===w?(n=e!=e?1:0,s=i):(s=T(M(e)/O),e*(r=C(2,-s))<1&&(s--,r*=2),(e+=s+d>=1?c/r:c*C(2,1-d))*r>=2&&(s++,r/=2),s+d>=i?(n=0,s=i):s+d>=1?(n=(e*r-1)*C(2,o),s+=d):(n=e*C(2,d-1)*C(2,o),s=0));o>=8;l[a++]=255&n,n/=256,o-=8);for(s=s<0;l[a++]=255&s,s/=256,u-=8);return l[--a]|=128*m,l}function P(e,o,t){var s,n=8*t-o-1,r=(1<>1,u=n-7,i=t-1,d=e[i--],c=127&d;for(d>>=7;u>0;c=256*c+e[i],i--,u-=8);for(s=c&(1<<-u)-1,c>>=-u,u+=o;u>0;s=256*s+e[i],i--,u-=8);if(0===c)c=1-l;else{if(c===r)return s?NaN:d?-w:w;s+=C(2,o),c-=l}return(d?-1:1)*s*C(2,c-o)}function L(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function R(e){return[255&e]}function F(e){return[255&e,e>>8&255]}function D(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function U(e){return A(e,52,8)}function z(e){return A(e,23,4)}function H(e,o,t){_(e[b],o,{get:function(){return this[t]}})}function G(e,o,t,s){var n=f(+t);if(n+o>e[B])throw x(v);var r=e[N]._b,l=n+e[I],u=r.slice(l,l+o);return s?u:u.reverse()}function W(e,o,t,s,n,r){var l=f(+t);if(l+o>e[B])throw x(v);for(var u=e[N]._b,i=l+e[I],d=s(+n),c=0;cY;)(V=q[Y++])in y||u(y,V,S[V]);r||(K.constructor=y)}var J=new g(new y(2)),X=g[b].setInt8;J.setInt8(0,2147483648),J.setInt8(1,2147483649),!J.getInt8(0)&&J.getInt8(1)||i(g[b],{setInt8:function(e,o){X.call(this,e,o<<24>>24)},setUint8:function(e,o){X.call(this,e,o<<24>>24)}},!0)}else y=function(e){c(this,y,"ArrayBuffer");var o=f(e);this._b=p.call(new Array(o),0),this[B]=o},g=function(e,o,t){c(this,g,"DataView"),c(e,y,"DataView");var s=e[B],n=a(o);if(n<0||n>s)throw x("Wrong offset!");if(n+(t=void 0===t?s-n:m(t))>s)throw x("Wrong length!");this[N]=e,this[I]=n,this[B]=t},n&&(H(y,"byteLength","_l"),H(g,"buffer","_b"),H(g,"byteLength","_l"),H(g,"byteOffset","_o")),i(g[b],{getInt8:function(e){return G(this,1,e)[0]<<24>>24},getUint8:function(e){return G(this,1,e)[0]},getInt16:function(e){var o=G(this,2,e,arguments[1]);return(o[1]<<8|o[0])<<16>>16},getUint16:function(e){var o=G(this,2,e,arguments[1]);return o[1]<<8|o[0]},getInt32:function(e){return L(G(this,4,e,arguments[1]))},getUint32:function(e){return L(G(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return P(G(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return P(G(this,8,e,arguments[1]),52,8)},setInt8:function(e,o){W(this,1,e,R,o)},setUint8:function(e,o){W(this,1,e,R,o)},setInt16:function(e,o){W(this,2,e,F,o,arguments[2])},setUint16:function(e,o){W(this,2,e,F,o,arguments[2])},setInt32:function(e,o){W(this,4,e,D,o,arguments[2])},setUint32:function(e,o){W(this,4,e,D,o,arguments[2])},setFloat32:function(e,o){W(this,4,e,z,o,arguments[2])},setFloat64:function(e,o){W(this,8,e,U,o,arguments[2])}});h(y,"ArrayBuffer"),h(g,"DataView"),u(g[b],l.VIEW,!0),o.ArrayBuffer=y,o.DataView=g},"./node_modules/core-js/modules/_typed.js": +/*! no static exports found */function(e,o,t){"use strict";var s=t(/*! ./_global */"./node_modules/core-js/modules/_global.js"),n=t(/*! ./_descriptors */"./node_modules/core-js/modules/_descriptors.js"),r=t(/*! ./_library */"./node_modules/core-js/modules/_library.js"),l=t(/*! ./_typed */"./node_modules/core-js/modules/_typed.js"),u=t(/*! ./_hide */"./node_modules/core-js/modules/_hide.js"),i=t(/*! ./_redefine-all */"./node_modules/core-js/modules/_redefine-all.js"),d=t(/*! ./_fails */"./node_modules/core-js/modules/_fails.js"),c=t(/*! ./_an-instance */"./node_modules/core-js/modules/_an-instance.js"),a=t(/*! ./_to-integer */"./node_modules/core-js/modules/_to-integer.js"),m=t(/*! ./_to-length */"./node_modules/core-js/modules/_to-length.js"),f=t(/*! ./_to-index */"./node_modules/core-js/modules/_to-index.js"),j=t(/*! ./_object-gopn */"./node_modules/core-js/modules/_object-gopn.js").f,_=t(/*! ./_object-dp */"./node_modules/core-js/modules/_object-dp.js").f,p=t(/*! ./_array-fill */"./node_modules/core-js/modules/_array-fill.js"),h=t(/*! ./_set-to-string-tag */"./node_modules/core-js/modules/_set-to-string-tag.js"),b="prototype",v="Wrong index!",y=s.ArrayBuffer,g=s.DataView,k=s.Math,x=s.RangeError,w=s.Infinity,S=y,E=k.abs,C=k.pow,T=k.floor,M=k.log,O=k.LN2,B=n?"_b":"buffer",N=n?"_l":"byteLength",A=n?"_o":"byteOffset";function I(e,o,t){var s,n,r,l=new Array(t),u=8*t-o-1,i=(1<>1,c=23===o?C(2,-24)-C(2,-77):0,a=0,m=e<0||0===e&&1/e<0?1:0;for((e=E(e))!=e||e===w?(n=e!=e?1:0,s=i):(s=T(M(e)/O),e*(r=C(2,-s))<1&&(s--,r*=2),(e+=s+d>=1?c/r:c*C(2,1-d))*r>=2&&(s++,r/=2),s+d>=i?(n=0,s=i):s+d>=1?(n=(e*r-1)*C(2,o),s+=d):(n=e*C(2,d-1)*C(2,o),s=0));o>=8;l[a++]=255&n,n/=256,o-=8);for(s=s<0;l[a++]=255&s,s/=256,u-=8);return l[--a]|=128*m,l}function L(e,o,t){var s,n=8*t-o-1,r=(1<>1,u=n-7,i=t-1,d=e[i--],c=127&d;for(d>>=7;u>0;c=256*c+e[i],i--,u-=8);for(s=c&(1<<-u)-1,c>>=-u,u+=o;u>0;s=256*s+e[i],i--,u-=8);if(0===c)c=1-l;else{if(c===r)return s?NaN:d?-w:w;s+=C(2,o),c-=l}return(d?-1:1)*s*C(2,c-o)}function P(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]}function R(e){return[255&e]}function F(e){return[255&e,e>>8&255]}function D(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]}function U(e){return I(e,52,8)}function H(e){return I(e,23,4)}function z(e,o,t){_(e[b],o,{get:function(){return this[t]}})}function G(e,o,t,s){var n=f(+t);if(n+o>e[N])throw x(v);var r=e[B]._b,l=n+e[A],u=r.slice(l,l+o);return s?u:u.reverse()}function W(e,o,t,s,n,r){var l=f(+t);if(l+o>e[N])throw x(v);for(var u=e[B]._b,i=l+e[A],d=s(+n),c=0;cY;)(V=q[Y++])in y||u(y,V,S[V]);r||(K.constructor=y)}var J=new g(new y(2)),X=g[b].setInt8;J.setInt8(0,2147483648),J.setInt8(1,2147483649),!J.getInt8(0)&&J.getInt8(1)||i(g[b],{setInt8:function(e,o){X.call(this,e,o<<24>>24)},setUint8:function(e,o){X.call(this,e,o<<24>>24)}},!0)}else y=function(e){c(this,y,"ArrayBuffer");var o=f(e);this._b=p.call(new Array(o),0),this[N]=o},g=function(e,o,t){c(this,g,"DataView"),c(e,y,"DataView");var s=e[N],n=a(o);if(n<0||n>s)throw x("Wrong offset!");if(n+(t=void 0===t?s-n:m(t))>s)throw x("Wrong length!");this[B]=e,this[A]=n,this[N]=t},n&&(z(y,"byteLength","_l"),z(g,"buffer","_b"),z(g,"byteLength","_l"),z(g,"byteOffset","_o")),i(g[b],{getInt8:function(e){return G(this,1,e)[0]<<24>>24},getUint8:function(e){return G(this,1,e)[0]},getInt16:function(e){var o=G(this,2,e,arguments[1]);return(o[1]<<8|o[0])<<16>>16},getUint16:function(e){var o=G(this,2,e,arguments[1]);return o[1]<<8|o[0]},getInt32:function(e){return P(G(this,4,e,arguments[1]))},getUint32:function(e){return P(G(this,4,e,arguments[1]))>>>0},getFloat32:function(e){return L(G(this,4,e,arguments[1]),23,4)},getFloat64:function(e){return L(G(this,8,e,arguments[1]),52,8)},setInt8:function(e,o){W(this,1,e,R,o)},setUint8:function(e,o){W(this,1,e,R,o)},setInt16:function(e,o){W(this,2,e,F,o,arguments[2])},setUint16:function(e,o){W(this,2,e,F,o,arguments[2])},setInt32:function(e,o){W(this,4,e,D,o,arguments[2])},setUint32:function(e,o){W(this,4,e,D,o,arguments[2])},setFloat32:function(e,o){W(this,4,e,H,o,arguments[2])},setFloat64:function(e,o){W(this,8,e,U,o,arguments[2])}});h(y,"ArrayBuffer"),h(g,"DataView"),u(g[b],l.VIEW,!0),o.ArrayBuffer=y,o.DataView=g},"./node_modules/core-js/modules/_typed.js": /*!************************************************!*\ !*** ./node_modules/core-js/modules/_typed.js ***! \************************************************/ @@ -1446,7 +1446,7 @@ /*!*****************************************************!*\ !*** ./node_modules/core-js/modules/es6.promise.js ***! \*****************************************************/ -/*! no static exports found */function(e,o,t){"use strict";var s,n,r,l,u=t(/*! ./_library */"./node_modules/core-js/modules/_library.js"),i=t(/*! ./_global */"./node_modules/core-js/modules/_global.js"),d=t(/*! ./_ctx */"./node_modules/core-js/modules/_ctx.js"),c=t(/*! ./_classof */"./node_modules/core-js/modules/_classof.js"),a=t(/*! ./_export */"./node_modules/core-js/modules/_export.js"),m=t(/*! ./_is-object */"./node_modules/core-js/modules/_is-object.js"),f=t(/*! ./_a-function */"./node_modules/core-js/modules/_a-function.js"),j=t(/*! ./_an-instance */"./node_modules/core-js/modules/_an-instance.js"),_=t(/*! ./_for-of */"./node_modules/core-js/modules/_for-of.js"),p=t(/*! ./_species-constructor */"./node_modules/core-js/modules/_species-constructor.js"),h=t(/*! ./_task */"./node_modules/core-js/modules/_task.js").set,b=t(/*! ./_microtask */"./node_modules/core-js/modules/_microtask.js")(),v=t(/*! ./_new-promise-capability */"./node_modules/core-js/modules/_new-promise-capability.js"),y=t(/*! ./_perform */"./node_modules/core-js/modules/_perform.js"),g=t(/*! ./_user-agent */"./node_modules/core-js/modules/_user-agent.js"),k=t(/*! ./_promise-resolve */"./node_modules/core-js/modules/_promise-resolve.js"),x=i.TypeError,w=i.process,S=w&&w.versions,E=S&&S.v8||"",C=i.Promise,T="process"==c(w),M=function(){},O=n=v.f,N=!!function(){try{var e=C.resolve(1),o=(e.constructor={})[t(/*! ./_wks */"./node_modules/core-js/modules/_wks.js")("species")]=function(e){e(M,M)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(M)instanceof o&&0!==E.indexOf("6.6")&&-1===g.indexOf("Chrome/66")}catch(e){}}(),B=function(e){var o;return!(!m(e)||"function"!=typeof(o=e.then))&&o},I=function(e,o){if(!e._n){e._n=!0;var t=e._c;b(function(){for(var s=e._v,n=1==e._s,r=0,l=function(o){var t,r,l,u=n?o.ok:o.fail,i=o.resolve,d=o.reject,c=o.domain;try{u?(n||(2==e._h&&L(e),e._h=1),!0===u?t=s:(c&&c.enter(),t=u(s),c&&(c.exit(),l=!0)),t===o.promise?d(x("Promise-chain cycle")):(r=B(t))?r.call(t,i,d):i(t)):d(s)}catch(e){c&&!l&&c.exit(),d(e)}};t.length>r;)l(t[r++]);e._c=[],e._n=!1,o&&!e._h&&A(e)})}},A=function(e){h.call(i,function(){var o,t,s,n=e._v,r=P(e);if(r&&(o=y(function(){T?w.emit("unhandledRejection",n,e):(t=i.onunhandledrejection)?t({promise:e,reason:n}):(s=i.console)&&s.error&&s.error("Unhandled promise rejection",n)}),e._h=T||P(e)?2:1),e._a=void 0,r&&o.e)throw o.v})},P=function(e){return 1!==e._h&&0===(e._a||e._c).length},L=function(e){h.call(i,function(){var o;T?w.emit("rejectionHandled",e):(o=i.onrejectionhandled)&&o({promise:e,reason:e._v})})},R=function(e){var o=this;o._d||(o._d=!0,(o=o._w||o)._v=e,o._s=2,o._a||(o._a=o._c.slice()),I(o,!0))},F=function(e){var o,t=this;if(!t._d){t._d=!0,t=t._w||t;try{if(t===e)throw x("Promise can't be resolved itself");(o=B(e))?b(function(){var s={_w:t,_d:!1};try{o.call(e,d(F,s,1),d(R,s,1))}catch(e){R.call(s,e)}}):(t._v=e,t._s=1,I(t,!1))}catch(e){R.call({_w:t,_d:!1},e)}}};N||(C=function(e){j(this,C,"Promise","_h"),f(e),s.call(this);try{e(d(F,this,1),d(R,this,1))}catch(e){R.call(this,e)}},(s=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=t(/*! ./_redefine-all */"./node_modules/core-js/modules/_redefine-all.js")(C.prototype,{then:function(e,o){var t=O(p(this,C));return t.ok="function"!=typeof e||e,t.fail="function"==typeof o&&o,t.domain=T?w.domain:void 0,this._c.push(t),this._a&&this._a.push(t),this._s&&I(this,!1),t.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new s;this.promise=e,this.resolve=d(F,e,1),this.reject=d(R,e,1)},v.f=O=function(e){return e===C||e===l?new r(e):n(e)}),a(a.G+a.W+a.F*!N,{Promise:C}),t(/*! ./_set-to-string-tag */"./node_modules/core-js/modules/_set-to-string-tag.js")(C,"Promise"),t(/*! ./_set-species */"./node_modules/core-js/modules/_set-species.js")("Promise"),l=t(/*! ./_core */"./node_modules/core-js/modules/_core.js").Promise,a(a.S+a.F*!N,"Promise",{reject:function(e){var o=O(this);return(0,o.reject)(e),o.promise}}),a(a.S+a.F*(u||!N),"Promise",{resolve:function(e){return k(u&&this===l?C:this,e)}}),a(a.S+a.F*!(N&&t(/*! ./_iter-detect */"./node_modules/core-js/modules/_iter-detect.js")(function(e){C.all(e).catch(M)})),"Promise",{all:function(e){var o=this,t=O(o),s=t.resolve,n=t.reject,r=y(function(){var t=[],r=0,l=1;_(e,!1,function(e){var u=r++,i=!1;t.push(void 0),l++,o.resolve(e).then(function(e){i||(i=!0,t[u]=e,--l||s(t))},n)}),--l||s(t)});return r.e&&n(r.v),t.promise},race:function(e){var o=this,t=O(o),s=t.reject,n=y(function(){_(e,!1,function(e){o.resolve(e).then(t.resolve,s)})});return n.e&&s(n.v),t.promise}})},"./node_modules/core-js/modules/es6.reflect.apply.js": +/*! no static exports found */function(e,o,t){"use strict";var s,n,r,l,u=t(/*! ./_library */"./node_modules/core-js/modules/_library.js"),i=t(/*! ./_global */"./node_modules/core-js/modules/_global.js"),d=t(/*! ./_ctx */"./node_modules/core-js/modules/_ctx.js"),c=t(/*! ./_classof */"./node_modules/core-js/modules/_classof.js"),a=t(/*! ./_export */"./node_modules/core-js/modules/_export.js"),m=t(/*! ./_is-object */"./node_modules/core-js/modules/_is-object.js"),f=t(/*! ./_a-function */"./node_modules/core-js/modules/_a-function.js"),j=t(/*! ./_an-instance */"./node_modules/core-js/modules/_an-instance.js"),_=t(/*! ./_for-of */"./node_modules/core-js/modules/_for-of.js"),p=t(/*! ./_species-constructor */"./node_modules/core-js/modules/_species-constructor.js"),h=t(/*! ./_task */"./node_modules/core-js/modules/_task.js").set,b=t(/*! ./_microtask */"./node_modules/core-js/modules/_microtask.js")(),v=t(/*! ./_new-promise-capability */"./node_modules/core-js/modules/_new-promise-capability.js"),y=t(/*! ./_perform */"./node_modules/core-js/modules/_perform.js"),g=t(/*! ./_user-agent */"./node_modules/core-js/modules/_user-agent.js"),k=t(/*! ./_promise-resolve */"./node_modules/core-js/modules/_promise-resolve.js"),x=i.TypeError,w=i.process,S=w&&w.versions,E=S&&S.v8||"",C=i.Promise,T="process"==c(w),M=function(){},O=n=v.f,B=!!function(){try{var e=C.resolve(1),o=(e.constructor={})[t(/*! ./_wks */"./node_modules/core-js/modules/_wks.js")("species")]=function(e){e(M,M)};return(T||"function"==typeof PromiseRejectionEvent)&&e.then(M)instanceof o&&0!==E.indexOf("6.6")&&-1===g.indexOf("Chrome/66")}catch(e){}}(),N=function(e){var o;return!(!m(e)||"function"!=typeof(o=e.then))&&o},A=function(e,o){if(!e._n){e._n=!0;var t=e._c;b(function(){for(var s=e._v,n=1==e._s,r=0,l=function(o){var t,r,l,u=n?o.ok:o.fail,i=o.resolve,d=o.reject,c=o.domain;try{u?(n||(2==e._h&&P(e),e._h=1),!0===u?t=s:(c&&c.enter(),t=u(s),c&&(c.exit(),l=!0)),t===o.promise?d(x("Promise-chain cycle")):(r=N(t))?r.call(t,i,d):i(t)):d(s)}catch(e){c&&!l&&c.exit(),d(e)}};t.length>r;)l(t[r++]);e._c=[],e._n=!1,o&&!e._h&&I(e)})}},I=function(e){h.call(i,function(){var o,t,s,n=e._v,r=L(e);if(r&&(o=y(function(){T?w.emit("unhandledRejection",n,e):(t=i.onunhandledrejection)?t({promise:e,reason:n}):(s=i.console)&&s.error&&s.error("Unhandled promise rejection",n)}),e._h=T||L(e)?2:1),e._a=void 0,r&&o.e)throw o.v})},L=function(e){return 1!==e._h&&0===(e._a||e._c).length},P=function(e){h.call(i,function(){var o;T?w.emit("rejectionHandled",e):(o=i.onrejectionhandled)&&o({promise:e,reason:e._v})})},R=function(e){var o=this;o._d||(o._d=!0,(o=o._w||o)._v=e,o._s=2,o._a||(o._a=o._c.slice()),A(o,!0))},F=function(e){var o,t=this;if(!t._d){t._d=!0,t=t._w||t;try{if(t===e)throw x("Promise can't be resolved itself");(o=N(e))?b(function(){var s={_w:t,_d:!1};try{o.call(e,d(F,s,1),d(R,s,1))}catch(e){R.call(s,e)}}):(t._v=e,t._s=1,A(t,!1))}catch(e){R.call({_w:t,_d:!1},e)}}};B||(C=function(e){j(this,C,"Promise","_h"),f(e),s.call(this);try{e(d(F,this,1),d(R,this,1))}catch(e){R.call(this,e)}},(s=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=t(/*! ./_redefine-all */"./node_modules/core-js/modules/_redefine-all.js")(C.prototype,{then:function(e,o){var t=O(p(this,C));return t.ok="function"!=typeof e||e,t.fail="function"==typeof o&&o,t.domain=T?w.domain:void 0,this._c.push(t),this._a&&this._a.push(t),this._s&&A(this,!1),t.promise},catch:function(e){return this.then(void 0,e)}}),r=function(){var e=new s;this.promise=e,this.resolve=d(F,e,1),this.reject=d(R,e,1)},v.f=O=function(e){return e===C||e===l?new r(e):n(e)}),a(a.G+a.W+a.F*!B,{Promise:C}),t(/*! ./_set-to-string-tag */"./node_modules/core-js/modules/_set-to-string-tag.js")(C,"Promise"),t(/*! ./_set-species */"./node_modules/core-js/modules/_set-species.js")("Promise"),l=t(/*! ./_core */"./node_modules/core-js/modules/_core.js").Promise,a(a.S+a.F*!B,"Promise",{reject:function(e){var o=O(this);return(0,o.reject)(e),o.promise}}),a(a.S+a.F*(u||!B),"Promise",{resolve:function(e){return k(u&&this===l?C:this,e)}}),a(a.S+a.F*!(B&&t(/*! ./_iter-detect */"./node_modules/core-js/modules/_iter-detect.js")(function(e){C.all(e).catch(M)})),"Promise",{all:function(e){var o=this,t=O(o),s=t.resolve,n=t.reject,r=y(function(){var t=[],r=0,l=1;_(e,!1,function(e){var u=r++,i=!1;t.push(void 0),l++,o.resolve(e).then(function(e){i||(i=!0,t[u]=e,--l||s(t))},n)}),--l||s(t)});return r.e&&n(r.v),t.promise},race:function(e){var o=this,t=O(o),s=t.reject,n=y(function(){_(e,!1,function(e){o.resolve(e).then(t.resolve,s)})});return n.e&&s(n.v),t.promise}})},"./node_modules/core-js/modules/es6.reflect.apply.js": /*!***********************************************************!*\ !*** ./node_modules/core-js/modules/es6.reflect.apply.js ***! \***********************************************************/ @@ -1626,7 +1626,7 @@ /*!****************************************************!*\ !*** ./node_modules/core-js/modules/es6.symbol.js ***! \****************************************************/ -/*! no static exports found */function(e,o,t){"use strict";var s=t(/*! ./_global */"./node_modules/core-js/modules/_global.js"),n=t(/*! ./_has */"./node_modules/core-js/modules/_has.js"),r=t(/*! ./_descriptors */"./node_modules/core-js/modules/_descriptors.js"),l=t(/*! ./_export */"./node_modules/core-js/modules/_export.js"),u=t(/*! ./_redefine */"./node_modules/core-js/modules/_redefine.js"),i=t(/*! ./_meta */"./node_modules/core-js/modules/_meta.js").KEY,d=t(/*! ./_fails */"./node_modules/core-js/modules/_fails.js"),c=t(/*! ./_shared */"./node_modules/core-js/modules/_shared.js"),a=t(/*! ./_set-to-string-tag */"./node_modules/core-js/modules/_set-to-string-tag.js"),m=t(/*! ./_uid */"./node_modules/core-js/modules/_uid.js"),f=t(/*! ./_wks */"./node_modules/core-js/modules/_wks.js"),j=t(/*! ./_wks-ext */"./node_modules/core-js/modules/_wks-ext.js"),_=t(/*! ./_wks-define */"./node_modules/core-js/modules/_wks-define.js"),p=t(/*! ./_enum-keys */"./node_modules/core-js/modules/_enum-keys.js"),h=t(/*! ./_is-array */"./node_modules/core-js/modules/_is-array.js"),b=t(/*! ./_an-object */"./node_modules/core-js/modules/_an-object.js"),v=t(/*! ./_is-object */"./node_modules/core-js/modules/_is-object.js"),y=t(/*! ./_to-iobject */"./node_modules/core-js/modules/_to-iobject.js"),g=t(/*! ./_to-primitive */"./node_modules/core-js/modules/_to-primitive.js"),k=t(/*! ./_property-desc */"./node_modules/core-js/modules/_property-desc.js"),x=t(/*! ./_object-create */"./node_modules/core-js/modules/_object-create.js"),w=t(/*! ./_object-gopn-ext */"./node_modules/core-js/modules/_object-gopn-ext.js"),S=t(/*! ./_object-gopd */"./node_modules/core-js/modules/_object-gopd.js"),E=t(/*! ./_object-dp */"./node_modules/core-js/modules/_object-dp.js"),C=t(/*! ./_object-keys */"./node_modules/core-js/modules/_object-keys.js"),T=S.f,M=E.f,O=w.f,N=s.Symbol,B=s.JSON,I=B&&B.stringify,A=f("_hidden"),P=f("toPrimitive"),L={}.propertyIsEnumerable,R=c("symbol-registry"),F=c("symbols"),D=c("op-symbols"),U=Object.prototype,z="function"==typeof N,H=s.QObject,G=!H||!H.prototype||!H.prototype.findChild,W=r&&d(function(){return 7!=x(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(e,o,t){var s=T(U,o);s&&delete U[o],M(e,o,t),s&&e!==U&&M(U,o,s)}:M,V=function(e){var o=F[e]=x(N.prototype);return o._k=e,o},K=z&&"symbol"==typeof N.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof N},q=function(e,o,t){return e===U&&q(D,o,t),b(e),o=g(o,!0),b(t),n(F,o)?(t.enumerable?(n(e,A)&&e[A][o]&&(e[A][o]=!1),t=x(t,{enumerable:k(0,!1)})):(n(e,A)||M(e,A,k(1,{})),e[A][o]=!0),W(e,o,t)):M(e,o,t)},Y=function(e,o){b(e);for(var t,s=p(o=y(o)),n=0,r=s.length;r>n;)q(e,t=s[n++],o[t]);return e},J=function(e){var o=L.call(this,e=g(e,!0));return!(this===U&&n(F,e)&&!n(D,e))&&(!(o||!n(this,e)||!n(F,e)||n(this,A)&&this[A][e])||o)},X=function(e,o){if(e=y(e),o=g(o,!0),e!==U||!n(F,o)||n(D,o)){var t=T(e,o);return!t||!n(F,o)||n(e,A)&&e[A][o]||(t.enumerable=!0),t}},$=function(e){for(var o,t=O(y(e)),s=[],r=0;t.length>r;)n(F,o=t[r++])||o==A||o==i||s.push(o);return s},Z=function(e){for(var o,t=e===U,s=O(t?D:y(e)),r=[],l=0;s.length>l;)!n(F,o=s[l++])||t&&!n(U,o)||r.push(F[o]);return r};z||(u((N=function(){if(this instanceof N)throw TypeError("Symbol is not a constructor!");var e=m(arguments.length>0?arguments[0]:void 0),o=function(t){this===U&&o.call(D,t),n(this,A)&&n(this[A],e)&&(this[A][e]=!1),W(this,e,k(1,t))};return r&&G&&W(U,e,{configurable:!0,set:o}),V(e)}).prototype,"toString",function(){return this._k}),S.f=X,E.f=q,t(/*! ./_object-gopn */"./node_modules/core-js/modules/_object-gopn.js").f=w.f=$,t(/*! ./_object-pie */"./node_modules/core-js/modules/_object-pie.js").f=J,t(/*! ./_object-gops */"./node_modules/core-js/modules/_object-gops.js").f=Z,r&&!t(/*! ./_library */"./node_modules/core-js/modules/_library.js")&&u(U,"propertyIsEnumerable",J,!0),j.f=function(e){return V(f(e))}),l(l.G+l.W+l.F*!z,{Symbol:N});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)f(Q[ee++]);for(var oe=C(f.store),te=0;oe.length>te;)_(oe[te++]);l(l.S+l.F*!z,"Symbol",{for:function(e){return n(R,e+="")?R[e]:R[e]=N(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var o in R)if(R[o]===e)return o},useSetter:function(){G=!0},useSimple:function(){G=!1}}),l(l.S+l.F*!z,"Object",{create:function(e,o){return void 0===o?x(e):Y(x(e),o)},defineProperty:q,defineProperties:Y,getOwnPropertyDescriptor:X,getOwnPropertyNames:$,getOwnPropertySymbols:Z}),B&&l(l.S+l.F*(!z||d(function(){var e=N();return"[null]"!=I([e])||"{}"!=I({a:e})||"{}"!=I(Object(e))})),"JSON",{stringify:function(e){for(var o,t,s=[e],n=1;arguments.length>n;)s.push(arguments[n++]);if(t=o=s[1],(v(o)||void 0!==e)&&!K(e))return h(o)||(o=function(e,o){if("function"==typeof t&&(o=t.call(this,e,o)),!K(o))return o}),s[1]=o,I.apply(B,s)}}),N.prototype[P]||t(/*! ./_hide */"./node_modules/core-js/modules/_hide.js")(N.prototype,P,N.prototype.valueOf),a(N,"Symbol"),a(Math,"Math",!0),a(s.JSON,"JSON",!0)},"./node_modules/core-js/modules/es6.typed.array-buffer.js": +/*! no static exports found */function(e,o,t){"use strict";var s=t(/*! ./_global */"./node_modules/core-js/modules/_global.js"),n=t(/*! ./_has */"./node_modules/core-js/modules/_has.js"),r=t(/*! ./_descriptors */"./node_modules/core-js/modules/_descriptors.js"),l=t(/*! ./_export */"./node_modules/core-js/modules/_export.js"),u=t(/*! ./_redefine */"./node_modules/core-js/modules/_redefine.js"),i=t(/*! ./_meta */"./node_modules/core-js/modules/_meta.js").KEY,d=t(/*! ./_fails */"./node_modules/core-js/modules/_fails.js"),c=t(/*! ./_shared */"./node_modules/core-js/modules/_shared.js"),a=t(/*! ./_set-to-string-tag */"./node_modules/core-js/modules/_set-to-string-tag.js"),m=t(/*! ./_uid */"./node_modules/core-js/modules/_uid.js"),f=t(/*! ./_wks */"./node_modules/core-js/modules/_wks.js"),j=t(/*! ./_wks-ext */"./node_modules/core-js/modules/_wks-ext.js"),_=t(/*! ./_wks-define */"./node_modules/core-js/modules/_wks-define.js"),p=t(/*! ./_enum-keys */"./node_modules/core-js/modules/_enum-keys.js"),h=t(/*! ./_is-array */"./node_modules/core-js/modules/_is-array.js"),b=t(/*! ./_an-object */"./node_modules/core-js/modules/_an-object.js"),v=t(/*! ./_is-object */"./node_modules/core-js/modules/_is-object.js"),y=t(/*! ./_to-iobject */"./node_modules/core-js/modules/_to-iobject.js"),g=t(/*! ./_to-primitive */"./node_modules/core-js/modules/_to-primitive.js"),k=t(/*! ./_property-desc */"./node_modules/core-js/modules/_property-desc.js"),x=t(/*! ./_object-create */"./node_modules/core-js/modules/_object-create.js"),w=t(/*! ./_object-gopn-ext */"./node_modules/core-js/modules/_object-gopn-ext.js"),S=t(/*! ./_object-gopd */"./node_modules/core-js/modules/_object-gopd.js"),E=t(/*! ./_object-dp */"./node_modules/core-js/modules/_object-dp.js"),C=t(/*! ./_object-keys */"./node_modules/core-js/modules/_object-keys.js"),T=S.f,M=E.f,O=w.f,B=s.Symbol,N=s.JSON,A=N&&N.stringify,I=f("_hidden"),L=f("toPrimitive"),P={}.propertyIsEnumerable,R=c("symbol-registry"),F=c("symbols"),D=c("op-symbols"),U=Object.prototype,H="function"==typeof B,z=s.QObject,G=!z||!z.prototype||!z.prototype.findChild,W=r&&d(function(){return 7!=x(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(e,o,t){var s=T(U,o);s&&delete U[o],M(e,o,t),s&&e!==U&&M(U,o,s)}:M,V=function(e){var o=F[e]=x(B.prototype);return o._k=e,o},K=H&&"symbol"==typeof B.iterator?function(e){return"symbol"==typeof e}:function(e){return e instanceof B},q=function(e,o,t){return e===U&&q(D,o,t),b(e),o=g(o,!0),b(t),n(F,o)?(t.enumerable?(n(e,I)&&e[I][o]&&(e[I][o]=!1),t=x(t,{enumerable:k(0,!1)})):(n(e,I)||M(e,I,k(1,{})),e[I][o]=!0),W(e,o,t)):M(e,o,t)},Y=function(e,o){b(e);for(var t,s=p(o=y(o)),n=0,r=s.length;r>n;)q(e,t=s[n++],o[t]);return e},J=function(e){var o=P.call(this,e=g(e,!0));return!(this===U&&n(F,e)&&!n(D,e))&&(!(o||!n(this,e)||!n(F,e)||n(this,I)&&this[I][e])||o)},X=function(e,o){if(e=y(e),o=g(o,!0),e!==U||!n(F,o)||n(D,o)){var t=T(e,o);return!t||!n(F,o)||n(e,I)&&e[I][o]||(t.enumerable=!0),t}},$=function(e){for(var o,t=O(y(e)),s=[],r=0;t.length>r;)n(F,o=t[r++])||o==I||o==i||s.push(o);return s},Z=function(e){for(var o,t=e===U,s=O(t?D:y(e)),r=[],l=0;s.length>l;)!n(F,o=s[l++])||t&&!n(U,o)||r.push(F[o]);return r};H||(u((B=function(){if(this instanceof B)throw TypeError("Symbol is not a constructor!");var e=m(arguments.length>0?arguments[0]:void 0),o=function(t){this===U&&o.call(D,t),n(this,I)&&n(this[I],e)&&(this[I][e]=!1),W(this,e,k(1,t))};return r&&G&&W(U,e,{configurable:!0,set:o}),V(e)}).prototype,"toString",function(){return this._k}),S.f=X,E.f=q,t(/*! ./_object-gopn */"./node_modules/core-js/modules/_object-gopn.js").f=w.f=$,t(/*! ./_object-pie */"./node_modules/core-js/modules/_object-pie.js").f=J,t(/*! ./_object-gops */"./node_modules/core-js/modules/_object-gops.js").f=Z,r&&!t(/*! ./_library */"./node_modules/core-js/modules/_library.js")&&u(U,"propertyIsEnumerable",J,!0),j.f=function(e){return V(f(e))}),l(l.G+l.W+l.F*!H,{Symbol:B});for(var Q="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ee=0;Q.length>ee;)f(Q[ee++]);for(var oe=C(f.store),te=0;oe.length>te;)_(oe[te++]);l(l.S+l.F*!H,"Symbol",{for:function(e){return n(R,e+="")?R[e]:R[e]=B(e)},keyFor:function(e){if(!K(e))throw TypeError(e+" is not a symbol!");for(var o in R)if(R[o]===e)return o},useSetter:function(){G=!0},useSimple:function(){G=!1}}),l(l.S+l.F*!H,"Object",{create:function(e,o){return void 0===o?x(e):Y(x(e),o)},defineProperty:q,defineProperties:Y,getOwnPropertyDescriptor:X,getOwnPropertyNames:$,getOwnPropertySymbols:Z}),N&&l(l.S+l.F*(!H||d(function(){var e=B();return"[null]"!=A([e])||"{}"!=A({a:e})||"{}"!=A(Object(e))})),"JSON",{stringify:function(e){for(var o,t,s=[e],n=1;arguments.length>n;)s.push(arguments[n++]);if(t=o=s[1],(v(o)||void 0!==e)&&!K(e))return h(o)||(o=function(e,o){if("function"==typeof t&&(o=t.call(this,e,o)),!K(o))return o}),s[1]=o,A.apply(N,s)}}),B.prototype[L]||t(/*! ./_hide */"./node_modules/core-js/modules/_hide.js")(B.prototype,L,B.prototype.valueOf),a(B,"Symbol"),a(Math,"Math",!0),a(s.JSON,"JSON",!0)},"./node_modules/core-js/modules/es6.typed.array-buffer.js": /*!****************************************************************!*\ !*** ./node_modules/core-js/modules/es6.typed.array-buffer.js ***! \****************************************************************/ @@ -1934,7 +1934,7 @@ /*!*****************************************************!*\ !*** ./node_modules/regenerator-runtime/runtime.js ***! \*****************************************************/ -/*! no static exports found */function(e,o){!function(o){"use strict";var t,s=Object.prototype,n=s.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},l=r.iterator||"@@iterator",u=r.asyncIterator||"@@asyncIterator",i=r.toStringTag||"@@toStringTag",d="object"==typeof e,c=o.regeneratorRuntime;if(c)d&&(e.exports=c);else{(c=o.regeneratorRuntime=d?e.exports:{}).wrap=y;var a="suspendedStart",m="suspendedYield",f="executing",j="completed",_={},p={};p[l]=function(){return this};var h=Object.getPrototypeOf,b=h&&h(h(N([])));b&&b!==s&&n.call(b,l)&&(p=b);var v=w.prototype=k.prototype=Object.create(p);x.prototype=v.constructor=w,w.constructor=x,w[i]=x.displayName="GeneratorFunction",c.isGeneratorFunction=function(e){var o="function"==typeof e&&e.constructor;return!!o&&(o===x||"GeneratorFunction"===(o.displayName||o.name))},c.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,i in e||(e[i]="GeneratorFunction")),e.prototype=Object.create(v),e},c.awrap=function(e){return{__await:e}},S(E.prototype),E.prototype[u]=function(){return this},c.AsyncIterator=E,c.async=function(e,o,t,s){var n=new E(y(e,o,t,s));return c.isGeneratorFunction(o)?n:n.next().then(function(e){return e.done?e.value:n.next()})},S(v),v[i]="Generator",v[l]=function(){return this},v.toString=function(){return"[object Generator]"},c.keys=function(e){var o=[];for(var t in e)o.push(t);return o.reverse(),function t(){for(;o.length;){var s=o.pop();if(s in e)return t.value=s,t.done=!1,t}return t.done=!0,t}},c.values=N,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(M),!e)for(var o in this)"t"===o.charAt(0)&&n.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var o=this;function s(s,n){return u.type="throw",u.arg=e,o.next=s,n&&(o.method="next",o.arg=t),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var l=this.tryEntries[r],u=l.completion;if("root"===l.tryLoc)return s("end");if(l.tryLoc<=this.prev){var i=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(i&&d){if(this.prev=0;--t){var s=this.tryEntries[t];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--o){var t=this.tryEntries[o];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),M(t),_}},catch:function(e){for(var o=this.tryEntries.length-1;o>=0;--o){var t=this.tryEntries[o];if(t.tryLoc===e){var s=t.completion;if("throw"===s.type){var n=s.arg;M(t)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,o,s){return this.delegate={iterator:N(e),resultName:o,nextLoc:s},"next"===this.method&&(this.arg=t),_}}}function y(e,o,t,s){var n=o&&o.prototype instanceof k?o:k,r=Object.create(n.prototype),l=new O(s||[]);return r._invoke=function(e,o,t){var s=a;return function(n,r){if(s===f)throw new Error("Generator is already running");if(s===j){if("throw"===n)throw r;return B()}for(t.method=n,t.arg=r;;){var l=t.delegate;if(l){var u=C(l,t);if(u){if(u===_)continue;return u}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(s===a)throw s=j,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);s=f;var i=g(e,o,t);if("normal"===i.type){if(s=t.done?j:m,i.arg===_)continue;return{value:i.arg,done:t.done}}"throw"===i.type&&(s=j,t.method="throw",t.arg=i.arg)}}}(e,t,l),r}function g(e,o,t){try{return{type:"normal",arg:e.call(o,t)}}catch(e){return{type:"throw",arg:e}}}function k(){}function x(){}function w(){}function S(e){["next","throw","return"].forEach(function(o){e[o]=function(e){return this._invoke(o,e)}})}function E(e){var o;this._invoke=function(t,s){function r(){return new Promise(function(o,r){!function o(t,s,r,l){var u=g(e[t],e,s);if("throw"!==u.type){var i=u.arg,d=i.value;return d&&"object"==typeof d&&n.call(d,"__await")?Promise.resolve(d.__await).then(function(e){o("next",e,r,l)},function(e){o("throw",e,r,l)}):Promise.resolve(d).then(function(e){i.value=e,r(i)},l)}l(u.arg)}(t,s,o,r)})}return o=o?o.then(r,r):r()}}function C(e,o){var s=e.iterator[o.method];if(s===t){if(o.delegate=null,"throw"===o.method){if(e.iterator.return&&(o.method="return",o.arg=t,C(e,o),"throw"===o.method))return _;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=g(s,e.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,_;var r=n.arg;return r?r.done?(o[e.resultName]=r.value,o.next=e.nextLoc,"return"!==o.method&&(o.method="next",o.arg=t),o.delegate=null,_):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,_)}function T(e){var o={tryLoc:e[0]};1 in e&&(o.catchLoc=e[1]),2 in e&&(o.finallyLoc=e[2],o.afterLoc=e[3]),this.tryEntries.push(o)}function M(e){var o=e.completion||{};o.type="normal",delete o.arg,e.completion=o}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(e){if(e){var o=e[l];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,r=function o(){for(;++s=0;--r){var l=this.tryEntries[r],u=l.completion;if("root"===l.tryLoc)return s("end");if(l.tryLoc<=this.prev){var i=n.call(l,"catchLoc"),d=n.call(l,"finallyLoc");if(i&&d){if(this.prev=0;--t){var s=this.tryEntries[t];if(s.tryLoc<=this.prev&&n.call(s,"finallyLoc")&&this.prev=0;--o){var t=this.tryEntries[o];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),M(t),_}},catch:function(e){for(var o=this.tryEntries.length-1;o>=0;--o){var t=this.tryEntries[o];if(t.tryLoc===e){var s=t.completion;if("throw"===s.type){var n=s.arg;M(t)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,o,s){return this.delegate={iterator:B(e),resultName:o,nextLoc:s},"next"===this.method&&(this.arg=t),_}}}function y(e,o,t,s){var n=o&&o.prototype instanceof k?o:k,r=Object.create(n.prototype),l=new O(s||[]);return r._invoke=function(e,o,t){var s=a;return function(n,r){if(s===f)throw new Error("Generator is already running");if(s===j){if("throw"===n)throw r;return N()}for(t.method=n,t.arg=r;;){var l=t.delegate;if(l){var u=C(l,t);if(u){if(u===_)continue;return u}}if("next"===t.method)t.sent=t._sent=t.arg;else if("throw"===t.method){if(s===a)throw s=j,t.arg;t.dispatchException(t.arg)}else"return"===t.method&&t.abrupt("return",t.arg);s=f;var i=g(e,o,t);if("normal"===i.type){if(s=t.done?j:m,i.arg===_)continue;return{value:i.arg,done:t.done}}"throw"===i.type&&(s=j,t.method="throw",t.arg=i.arg)}}}(e,t,l),r}function g(e,o,t){try{return{type:"normal",arg:e.call(o,t)}}catch(e){return{type:"throw",arg:e}}}function k(){}function x(){}function w(){}function S(e){["next","throw","return"].forEach(function(o){e[o]=function(e){return this._invoke(o,e)}})}function E(e){var o;this._invoke=function(t,s){function r(){return new Promise(function(o,r){!function o(t,s,r,l){var u=g(e[t],e,s);if("throw"!==u.type){var i=u.arg,d=i.value;return d&&"object"==typeof d&&n.call(d,"__await")?Promise.resolve(d.__await).then(function(e){o("next",e,r,l)},function(e){o("throw",e,r,l)}):Promise.resolve(d).then(function(e){i.value=e,r(i)},l)}l(u.arg)}(t,s,o,r)})}return o=o?o.then(r,r):r()}}function C(e,o){var s=e.iterator[o.method];if(s===t){if(o.delegate=null,"throw"===o.method){if(e.iterator.return&&(o.method="return",o.arg=t,C(e,o),"throw"===o.method))return _;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return _}var n=g(s,e.iterator,o.arg);if("throw"===n.type)return o.method="throw",o.arg=n.arg,o.delegate=null,_;var r=n.arg;return r?r.done?(o[e.resultName]=r.value,o.next=e.nextLoc,"return"!==o.method&&(o.method="next",o.arg=t),o.delegate=null,_):r:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,_)}function T(e){var o={tryLoc:e[0]};1 in e&&(o.catchLoc=e[1]),2 in e&&(o.finallyLoc=e[2],o.afterLoc=e[3]),this.tryEntries.push(o)}function M(e){var o=e.completion||{};o.type="normal",delete o.arg,e.completion=o}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function B(e){if(e){var o=e[l];if(o)return o.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,r=function o(){for(;++s'},{number:3,tag:"H3",svg:''},{number:4,tag:"H4",svg:''}]}}],[{key:"onPasteHandler",value:function(e){var o=4;switch(e.tagName){case"H1":case"H2":o=2;break;case"H3":o=3}return{level:o,text:e.innerHTML}}},{key:"onPaste",get:function(){return{handler:e.onPasteHandler,tags:["H1","H2","H3","H4","H5","H6"]}}},{key:"toolboxIcon",get:function(){return''}}]),e}();e.exports=n},function(e,o,t){var s=t(2);"string"==typeof s&&(s=[[e.i,s,""]]),t(4)(s,{hmr:!0,transform:void 0,insertInto:void 0}),s.locals&&(e.exports=s.locals)},function(e,o,t){(e.exports=t(3)(!1)).push([e.i,"/**\n * Plugin styles\n */\n.ce-header {\n padding: 1em 0;\n margin: 0;\n margin-bottom: -0.9em;\n line-height: 1.5em;\n outline: none;\n}\n\n.ce-header p,\n.ce-header div{\n padding: 0 !important;\n margin: 0 !important;\n}\n\n/**\n * Styles for Plugin icon in Toolbar\n */\n.ce-header__icon {}\n",""])},function(e,o){e.exports=function(e){var o=[];return o.toString=function(){return this.map(function(o){var t=function(e,o){var t=e[1]||"",s=e[3];if(!s)return t;if(o&&"function"==typeof btoa){var n=function(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}(s),r=s.sources.map(function(e){return"/*# sourceURL="+s.sourceRoot+e+" */"});return[t].concat(r).concat([n]).join("\n")}return[t].join("\n")}(o,e);return o[2]?"@media "+o[2]+"{"+t+"}":t}).join("")},o.i=function(e,t){"string"==typeof e&&(e=[[null,e,""]]);for(var s={},n=0;n=0&&i.splice(o,1)}function j(e){var o=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),_(o,e.attrs),m(e,o),o}function _(e,o){Object.keys(o).forEach(function(t){e.setAttribute(t,o[t])})}function p(e,o){var t,s,n,r;if(o.transform&&e.css){if(!(r=o.transform(e.css)))return function(){};e.css=r}if(o.singleton){var i=u++;t=l||(l=j(o)),s=b.bind(null,t,i,!1),n=b.bind(null,t,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(t=function(e){var o=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",_(o,e.attrs),m(e,o),o}(o),s=function(e,o,t){var s=t.css,n=t.sourceMap,r=void 0===o.convertToAbsoluteUrls&&n;(o.convertToAbsoluteUrls||r)&&(s=d(s)),n&&(s+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var l=new Blob([s],{type:"text/css"}),u=e.href;e.href=URL.createObjectURL(l),u&&URL.revokeObjectURL(u)}.bind(null,t,o),n=function(){f(t),t.href&&URL.revokeObjectURL(t.href)}):(t=j(o),s=function(e,o){var t=o.css,s=o.media;if(s&&e.setAttribute("media",s),e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}.bind(null,t),n=function(){f(t)});return s(e),function(o){if(o){if(o.css===e.css&&o.media===e.media&&o.sourceMap===e.sourceMap)return;s(e=o)}else n()}}e.exports=function(e,o){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(o=o||{}).attrs="object"==typeof o.attrs?o.attrs:{},o.singleton||"boolean"==typeof o.singleton||(o.singleton=n()),o.insertInto||(o.insertInto="head"),o.insertAt||(o.insertAt="bottom");var t=a(e,o);return c(t,o),function(e){for(var n=[],r=0;rn;)e.push(arguments[n++]);return m[++y]=function(){c("function"==typeof t?t:Function(t),e)},r(y),y},p=function(t){delete m[t]},"process"==n(9)(l)?r=function(t){l.nextTick(u(g,t,1))}:d&&d.now?r=function(t){d.now(u(g,t,1))}:v?(i=(o=new v).port2,o.port1.onmessage=w,r=u(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r="onreadystatechange"in s("script")?function(t){a.appendChild(s("script")).onreadystatechange=function(){a.removeChild(this),g.call(t)}}:function(t){setTimeout(u(g,t,1),0)}),t.exports={set:h,clear:p}},function(t,e,n){"use strict";var r=n(8);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}(t)}},function(t,e,n){ +var Docs=function(t){function e(e){for(var n,o,i=e[0],a=e[1],u=0,s=[];un;)e.push(arguments[n++]);return m[++y]=function(){u("function"==typeof t?t:Function(t),e)},r(y),y},p=function(t){delete m[t]},"process"==n(9)(l)?r=function(t){l.nextTick(a(g,t,1))}:v&&v.now?r=function(t){v.now(a(g,t,1))}:d?(i=(o=new d).port2,o.port1.onmessage=w,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r="onreadystatechange"in s("script")?function(t){c.appendChild(s("script")).onreadystatechange=function(){c.removeChild(this),g.call(t)}}:function(t){setTimeout(a(g,t,1),0)}),t.exports={set:h,clear:p}},function(t,e,n){"use strict";var r=n(8);t.exports.f=function(t){return new function(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}(t)}},function(t,e,n){ /*! * CodeX Module Dispatcher — Initialize frontend Modules from the DOM without inline scripts * @@ -7,4 +7,4 @@ var Docs=function(t){function e(e){for(var n,o,i=e[0],u=e[1],c=0,s=[];c=0;o--)e.push.apply(e,r(this.extractModulesData(n[o])));return e}},{key:"extractModulesData",value:function(t){var e=this,n=[],r=t.dataset.module;return(r=r.replace(/\s+/," ")).split(" ").forEach(function(r,o){var i=new u({name:r,element:t,settings:e.getModuleSettings(t,o,r),moduleClass:e.Library[r]});n.push(i)}),n}},{key:"getModuleSettings",value:function(t,e,n){var r=t.querySelector("module-settings"),o=void 0;if(!r)return null;try{o=r.textContent.trim(),o=JSON.parse(o)}catch(t){return console.warn("Can not parse Module «"+n+"» settings bacause of: "+t),console.groupCollapsed(n+" settings"),console.log(o),console.groupEnd(),null}return Array.isArray(o)?o[e]?o[e]:null:0===e?o:(console.warn("Wrong settings format. For several Modules use an array instead of object."),null)}},{key:"initModules",value:function(){console.groupCollapsed("ModuleDispatcher"),this.modules.forEach(function(t){t.init()}),console.groupEnd()}}]),t}();e.default=c}])},function(t,e,n){t.exports=!n(5)&&!n(13)(function(){return 7!=Object.defineProperty(n(14)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(4);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){},,function(t,e,n){"use strict";var r,o,i,u,c=n(18),a=n(0),s=n(7),f=n(19),l=n(11),h=n(4),p=n(8),v=n(31),d=n(32),y=n(38),m=n(21).set,g=n(41)(),w=n(22),x=n(42),b=n(43),_=n(44),j=a.TypeError,E=a.process,P=E&&E.versions,O=P&&P.v8||"",L=a.Promise,M="process"==f(E),S=function(){},k=o=w.f,T=!!function(){try{var t=L.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(S,S)};return(M||"function"==typeof PromiseRejectionEvent)&&t.then(S)instanceof e&&0!==O.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),C=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},F=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){for(var r=t._v,o=1==t._s,i=0,u=function(e){var n,i,u,c=o?e.ok:e.fail,a=e.resolve,s=e.reject,f=e.domain;try{c?(o||(2==t._h&&D(t),t._h=1),!0===c?n=r:(f&&f.enter(),n=c(r),f&&(f.exit(),u=!0)),n===e.promise?s(j("Promise-chain cycle")):(i=C(n))?i.call(n,a,s):a(n)):s(r)}catch(t){f&&!u&&f.exit(),s(t)}};n.length>i;)u(n[i++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})}},A=function(t){m.call(a,function(){var e,n,r,o=t._v,i=N(t);if(i&&(e=x(function(){M?E.emit("unhandledRejection",o,t):(n=a.onunhandledrejection)?n({promise:t,reason:o}):(r=a.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=M||N(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},N=function(t){return 1!==t._h&&0===(t._a||t._c).length},D=function(t){m.call(a,function(){var e;M?E.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},R=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),F(e,!0))},G=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw j("Promise can't be resolved itself");(e=C(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,s(G,r,1),s(R,r,1))}catch(t){R.call(r,t)}}):(n._v=t,n._s=1,F(n,!1))}catch(t){R.call({_w:n,_d:!1},t)}}};T||(L=function(t){v(this,L,"Promise","_h"),p(t),r.call(this);try{t(s(G,this,1),s(R,this,1))}catch(t){R.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(45)(L.prototype,{then:function(t,e){var n=k(y(this,L));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=M?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&F(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=s(G,t,1),this.reject=s(R,t,1)},w.f=k=function(t){return t===L||t===u?new i(t):o(t)}),l(l.G+l.W+l.F*!T,{Promise:L}),n(46)(L,"Promise"),n(47)("Promise"),u=n(2).Promise,l(l.S+l.F*!T,"Promise",{reject:function(t){var e=k(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(c||!T),"Promise",{resolve:function(t){return _(c&&this===u?L:this,t)}}),l(l.S+l.F*!(T&&n(48)(function(t){L.all(t).catch(S)})),"Promise",{all:function(t){var e=this,n=k(e),r=n.resolve,o=n.reject,i=x(function(){var n=[],i=0,u=1;d(t,!1,function(t){var c=i++,a=!1;n.push(void 0),u++,e.resolve(t).then(function(t){a||(a=!0,n[c]=t,--u||r(n))},o)}),--u||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=k(e),r=n.reject,o=x(function(){d(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(t,e,n){var r=n(2),o=n(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(18)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(7),o=n(33),i=n(34),u=n(3),c=n(35),a=n(37),s={},f={};(e=t.exports=function(t,e,n,l,h){var p,v,d,y,m=h?function(){return t}:a(t),g=r(n,l,e?2:1),w=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(p=c(t.length);p>w;w++)if((y=e?g(u(v=t[w])[0],v[1]):g(t[w]))===s||y===f)return y}else for(d=m.call(t);!(v=d.next()).done;)if((y=o(d,g,v.value,e))===s||y===f)return y}).BREAK=s,e.RETURN=f},function(t,e,n){var r=n(3);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r=n(20),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){var r=n(36),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(19),o=n(1)("iterator"),i=n(20);t.exports=n(2).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){var r=n(3),o=n(8),i=n(1)("species");t.exports=function(t,e){var n,u=r(t).constructor;return void 0===u||void 0==(n=r(u)[i])?e:o(n)}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(0),o=n(21).set,i=r.MutationObserver||r.WebKitMutationObserver,u=r.process,c=r.Promise,a="process"==n(9)(u);t.exports=function(){var t,e,n,s=function(){var r,o;for(a&&(r=u.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(a)n=function(){u.nextTick(s)};else if(!i||r.navigator&&r.navigator.standalone)if(c&&c.resolve){var f=c.resolve(void 0);n=function(){f.then(s)}}else n=function(){o.call(r,s)};else{var l=!0,h=document.createTextNode("");new i(s).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(0).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(3),o=n(4),i=n(22);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(15);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){var r=n(6).f,o=n(16),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(0),o=n(6),i=n(5),u=n(1)("species");t.exports=function(t){var e=r[t];i&&e&&!e[u]&&o.f(e,u,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],u=i[r]();u.next=function(){return{done:n=!0}},i[r]=function(){return u},t(i)}catch(t){}return n}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},u=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag",s="object"==typeof t,f=e.regeneratorRuntime;if(f)s&&(t.exports=f);else{(f=e.regeneratorRuntime=s?t.exports:{}).wrap=x;var l="suspendedStart",h="suspendedYield",p="executing",v="completed",d={},y={};y[u]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(T([])));g&&g!==r&&o.call(g,u)&&(y=g);var w=E.prototype=_.prototype=Object.create(y);j.prototype=w.constructor=E,E.constructor=j,E[a]=j.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===j||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,a in t||(t[a]="GeneratorFunction")),t.prototype=Object.create(w),t},f.awrap=function(t){return{__await:t}},P(O.prototype),O.prototype[c]=function(){return this},f.AsyncIterator=O,f.async=function(t,e,n,r){var o=new O(x(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},P(w),w[a]="Generator",w[u]=function(){return this},w.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=T,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return c.type="throw",c.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var u=this.tryEntries[i],c=u.completion;if("root"===u.tryLoc)return r("end");if(u.tryLoc<=this.prev){var a=o.call(u,"catchLoc"),s=o.call(u,"finallyLoc");if(a&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),S(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;S(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),d}}}function x(t,e,n,r){var o=e&&e.prototype instanceof _?e:_,i=Object.create(o.prototype),u=new k(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return C()}for(n.method=o,n.arg=i;;){var u=n.delegate;if(u){var c=L(u,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var a=b(t,e,n);if("normal"===a.type){if(r=n.done?v:h,a.arg===d)continue;return{value:a.arg,done:n.done}}"throw"===a.type&&(r=v,n.method="throw",n.arg=a.arg)}}}(t,n,u),i}function b(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function j(){}function E(){}function P(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function O(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,u){var c=b(t[n],t,r);if("throw"!==c.type){var a=c.arg,s=a.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(t){e("next",t,i,u)},function(t){e("throw",t,i,u)}):Promise.resolve(s).then(function(t){a.value=t,i(a)},u)}u(c.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function L(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,L(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=b(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function T(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r=0;o--)e.push.apply(e,r(this.extractModulesData(n[o])));return e}},{key:"extractModulesData",value:function(t){var e=this,n=[],r=t.dataset.module;return(r=r.replace(/\s+/," ")).split(" ").forEach(function(r,o){var i=new a({name:r,element:t,settings:e.getModuleSettings(t,o,r),moduleClass:e.Library[r]});n.push(i)}),n}},{key:"getModuleSettings",value:function(t,e,n){var r=t.querySelector("module-settings"),o=void 0;if(!r)return null;try{o=r.textContent.trim(),o=JSON.parse(o)}catch(t){return console.warn("Can not parse Module «"+n+"» settings bacause of: "+t),console.groupCollapsed(n+" settings"),console.log(o),console.groupEnd(),null}return Array.isArray(o)?o[e]?o[e]:null:0===e?o:(console.warn("Wrong settings format. For several Modules use an array instead of object."),null)}},{key:"initModules",value:function(){console.groupCollapsed("ModuleDispatcher"),this.modules.forEach(function(t){t.init()}),console.groupEnd()}}]),t}();e.default=u}])},function(t,e,n){t.exports=!n(5)&&!n(13)(function(){return 7!=Object.defineProperty(n(14)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(4);t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){},,function(t,e,n){"use strict";var r,o,i,a,u=n(18),c=n(0),s=n(7),f=n(19),l=n(11),h=n(4),p=n(8),d=n(31),v=n(32),y=n(38),m=n(21).set,g=n(41)(),w=n(22),x=n(42),b=n(43),_=n(44),j=c.TypeError,E=c.process,P=E&&E.versions,S=P&&P.v8||"",O=c.Promise,k="process"==f(E),L=function(){},M=o=w.f,T=!!function(){try{var t=O.resolve(1),e=(t.constructor={})[n(1)("species")]=function(t){t(L,L)};return(k||"function"==typeof PromiseRejectionEvent)&&t.then(L)instanceof e&&0!==S.indexOf("6.6")&&-1===b.indexOf("Chrome/66")}catch(t){}}(),C=function(t){var e;return!(!h(t)||"function"!=typeof(e=t.then))&&e},F=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){for(var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,u=o?e.ok:e.fail,c=e.resolve,s=e.reject,f=e.domain;try{u?(o||(2==t._h&&R(t),t._h=1),!0===u?n=r:(f&&f.enter(),n=u(r),f&&(f.exit(),a=!0)),n===e.promise?s(j("Promise-chain cycle")):(i=C(n))?i.call(n,c,s):c(n)):s(r)}catch(t){f&&!a&&f.exit(),s(t)}};n.length>i;)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})}},A=function(t){m.call(c,function(){var e,n,r,o=t._v,i=N(t);if(i&&(e=x(function(){k?E.emit("unhandledRejection",o,t):(n=c.onunhandledrejection)?n({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=k||N(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},N=function(t){return 1!==t._h&&0===(t._a||t._c).length},R=function(t){m.call(c,function(){var e;k?E.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},D=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),F(e,!0))},G=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw j("Promise can't be resolved itself");(e=C(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,s(G,r,1),s(D,r,1))}catch(t){D.call(r,t)}}):(n._v=t,n._s=1,F(n,!1))}catch(t){D.call({_w:n,_d:!1},t)}}};T||(O=function(t){d(this,O,"Promise","_h"),p(t),r.call(this);try{t(s(G,this,1),s(D,this,1))}catch(t){D.call(this,t)}},(r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=n(45)(O.prototype,{then:function(t,e){var n=M(y(this,O));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=k?E.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&F(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=s(G,t,1),this.reject=s(D,t,1)},w.f=M=function(t){return t===O||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!T,{Promise:O}),n(46)(O,"Promise"),n(47)("Promise"),a=n(2).Promise,l(l.S+l.F*!T,"Promise",{reject:function(t){var e=M(this);return(0,e.reject)(t),e.promise}}),l(l.S+l.F*(u||!T),"Promise",{resolve:function(t){return _(u&&this===a?O:this,t)}}),l(l.S+l.F*!(T&&n(48)(function(t){O.all(t).catch(L)})),"Promise",{all:function(t){var e=this,n=M(e),r=n.resolve,o=n.reject,i=x(function(){var n=[],i=0,a=1;v(t,!1,function(t){var u=i++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[u]=t,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=M(e),r=n.reject,o=x(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},function(t,e,n){var r=n(2),o=n(0),i=o["__core-js_shared__"]||(o["__core-js_shared__"]={});(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(18)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},function(t,e,n){var r=n(7),o=n(33),i=n(34),a=n(3),u=n(35),c=n(37),s={},f={};(e=t.exports=function(t,e,n,l,h){var p,d,v,y,m=h?function(){return t}:c(t),g=r(n,l,e?2:1),w=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(p=u(t.length);p>w;w++)if((y=e?g(a(d=t[w])[0],d[1]):g(t[w]))===s||y===f)return y}else for(v=m.call(t);!(d=v.next()).done;)if((y=o(v,g,d.value,e))===s||y===f)return y}).BREAK=s,e.RETURN=f},function(t,e,n){var r=n(3);t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&r(i.call(t)),e}}},function(t,e,n){var r=n(20),o=n(1)("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},function(t,e,n){var r=n(36),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(19),o=n(1)("iterator"),i=n(20);t.exports=n(2).getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},function(t,e,n){var r=n(3),o=n(8),i=n(1)("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[i])?e:o(n)}},function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var r=n(0).document;t.exports=r&&r.documentElement},function(t,e,n){var r=n(0),o=n(21).set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,u=r.Promise,c="process"==n(9)(a);t.exports=function(){var t,e,n,s=function(){var r,o;for(c&&(r=a.domain)&&r.exit();t;){o=t.fn,t=t.next;try{o()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(s)};else if(!i||r.navigator&&r.navigator.standalone)if(u&&u.resolve){var f=u.resolve(void 0);n=function(){f.then(s)}}else n=function(){o.call(r,s)};else{var l=!0,h=document.createTextNode("");new i(s).observe(h,{characterData:!0}),n=function(){h.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},function(t,e){t.exports=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}}},function(t,e,n){var r=n(0).navigator;t.exports=r&&r.userAgent||""},function(t,e,n){var r=n(3),o=n(4),i=n(22);t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t);return(0,n.resolve)(e),n.promise}},function(t,e,n){var r=n(15);t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},function(t,e,n){var r=n(6).f,o=n(16),i=n(1)("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},function(t,e,n){"use strict";var r=n(0),o=n(6),i=n(5),a=n(1)("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e,n){var r=n(1)("iterator"),o=!1;try{var i=[7][r]();i.return=function(){o=!0},Array.from(i,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],a=i[r]();a.next=function(){return{done:n=!0}},i[r]=function(){return a},t(i)}catch(t){}return n}},function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",s="object"==typeof t,f=e.regeneratorRuntime;if(f)s&&(t.exports=f);else{(f=e.regeneratorRuntime=s?t.exports:{}).wrap=x;var l="suspendedStart",h="suspendedYield",p="executing",d="completed",v={},y={};y[a]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(T([])));g&&g!==r&&o.call(g,a)&&(y=g);var w=E.prototype=_.prototype=Object.create(y);j.prototype=w.constructor=E,E.constructor=j,E[c]=j.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===j||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(w),t},f.awrap=function(t){return{__await:t}},P(S.prototype),S.prototype[u]=function(){return this},f.AsyncIterator=S,f.async=function(t,e,n,r){var o=new S(x(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},P(w),w[c]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=T,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(L),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return u.type="throw",u.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;L(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function x(t,e,n,r){var o=e&&e.prototype instanceof _?e:_,i=Object.create(o.prototype),a=new M(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===d){if("throw"===o)throw i;return C()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var u=O(a,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var c=b(t,e,n);if("normal"===c.type){if(r=n.done?d:h,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=d,n.method="throw",n.arg=c.arg)}}}(t,n,a),i}function b(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function _(){}function j(){}function E(){}function P(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(t){var e;this._invoke=function(n,r){function i(){return new Promise(function(e,i){!function e(n,r,i,a){var u=b(t[n],t,r);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(s).then(function(t){c.value=t,i(c)},a)}a(u.arg)}(n,r,e,i)})}return e=e?e.then(i,i):i()}}function O(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,O(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=b(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){for(;++r} */ static async insert(data) { - if (!Pages.validate(data)) { - throw new Error('Invalid request format'); + try { + Pages.validate(data); + + const page = new Model(data); + + return page.save(); + } catch (validationError) { + throw new Error(validationError); } - - const page = new Model(data); - - return page.save(); } /** * Check PageData object for required fields * * @param {PageData} data - * @returns {boolean} + * @throws {Error} - validation error */ static validate(data) { - return Pages.REQUIRED_FIELDS.every(field => typeof data[field] !== 'undefined'); + const allRequiredFields = Pages.REQUIRED_FIELDS.every(field => typeof data[field] !== 'undefined'); + + if (!allRequiredFields) { + throw new Error('Some of required fields is missed'); + } + + const hasBlocks = data.body && data.body.blocks && Array.isArray(data.body.blocks) && data.body.blocks.length > 0; + + if (!hasBlocks) { + throw new Error('Page body is invalid'); + } + + const hasHeaderAsFirstBlock = data.body.blocks[0].type === 'header'; + + if (!hasHeaderAsFirstBlock) { + throw new Error('First page Block must be a Header'); + } + + const headerIsNotEmpty = data.body.blocks[0].data.text.replace('
', '').trim() !== ''; + + if (!headerIsNotEmpty) { + throw new Error('Please, fill page Header'); + } } /** diff --git a/src/frontend/js/classes/editor.js b/src/frontend/js/classes/editor.js index 068829a..d191224 100644 --- a/src/frontend/js/classes/editor.js +++ b/src/frontend/js/classes/editor.js @@ -1,7 +1,42 @@ import CodeXEditor from 'codex.editor'; +import Header from 'codex.editor.header'; +/** + * Class for working with Editor.js + */ export default class Editor { + /** + * Creates Editor instance + */ constructor() { - this.editor = new CodeXEditor(); + this.editor = new CodeXEditor({ + tools: { + header: { + class: Header, + config: { + placeholder: 'Enter a title' + } + } + }, + data: { + blocks: [ + { + type: 'header', + data: { + text: '', + level: 2 + } + } + ] + } + }); + } + + /** + * Return Editor data + * @return {Promise.<{}>} + */ + save() { + return this.editor.saver.save(); } } diff --git a/src/frontend/js/modules/writing.js b/src/frontend/js/modules/writing.js index 91a66fb..37f00fd 100644 --- a/src/frontend/js/modules/writing.js +++ b/src/frontend/js/modules/writing.js @@ -1,29 +1,115 @@ /** * Module for pages create/edit */ +/** + * @typedef {object} editorData + * @property {{type, data}[]} blocks - array of Blocks + * @property {string} version - used Editor version + * @property {number} time - saving time + */ + export default class Writing { + /** + * Creates base properties + */ constructor(){ - this.editorWrapper = null; this.editor = null; + this.nodes = { + editorWrapper: null, + saveButton: null, + parentIdSelector: null, + } } /** * Called by ModuleDispatcher to initialize module from DOM + * @param {object} settings - module settings + * @param {HTMLElement} moduleEl - module element */ - init(config, moduleEl) { - this.editorWrapper = document.createElement('div'); - this.editorWrapper.id = 'codex-editor'; + init(settings, moduleEl) { + /** + * Create Editor + */ + this.nodes.editorWrapper = document.createElement('div'); + this.nodes.editorWrapper.id = 'codex-editor'; - moduleEl.appendChild(this.editorWrapper); + moduleEl.appendChild(this.nodes.editorWrapper); this.loadEditor().then((editor) => { this.editor = editor; - }) + }); + + /** + * Activate form elements + */ + this.nodes.saveButton = moduleEl.querySelector('[name="js-submit"]'); + this.nodes.saveButton.addEventListener('click', () => { + this.saveButtonClicked(); + }); + this.nodes.parentIdSelector = moduleEl.querySelector('[name="parent"]'); }; + /** + * Loads class for working with Editor + * @return {Promise} + */ async loadEditor(){ const {default: Editor} = await import(/* webpackChunkName: "editor" */ './../classes/editor'); return new Editor(); } + + /** + * Returns all writing form data + * @throws {Error} - validation error + * @return {Promise.<{parent: string, body: {editorData}}>} + */ + async getData(){ + const editorData = await this.editor.save(); + const firstBlock = editorData.blocks.length ? editorData.blocks[0] : null; + const title = firstBlock && firstBlock.type === 'header' ? firstBlock.data.text : null; + + if (!title) { + throw new Error('Entry should start with Header'); + } + + return { + parent: this.nodes.parentIdSelector.value, + body: editorData + }; + } + + /** + * Handler for clicks on the Save button + */ + async saveButtonClicked(){ + try { + const writingData = await this.getData(); + + try { + let response = await fetch('/page', { + method: 'PUT', + headers: { + "Content-Type": "application/json; charset=utf-8", + }, + body: JSON.stringify(writingData), + }); + + response = await response.json(); + + if (response.success){ + document.location = '/page/' + response.result._id; + } else { + alert(response.error); + console.log('Validation failed:', response.error); + } + + } catch (sendingError) { + console.log('Saving request failed:', sendingError); + } + } catch (savingError){ + alert(savingError); + console.log('Saving error: ', savingError); + } + } } diff --git a/src/frontend/styles/components/writing.pcss b/src/frontend/styles/components/writing.pcss new file mode 100644 index 0000000..a557019 --- /dev/null +++ b/src/frontend/styles/components/writing.pcss @@ -0,0 +1,20 @@ +.writing-header { + display: flex; + padding: 15px 0; + margin-top: calc(-1 * var(--layout-padding-vertical)); + position: sticky; + top: 0; + background: #fff; + z-index: 2; + box-shadow: 0 3px 10px #fff; + + &__save { + @apply --button; + margin-left: auto; + } + + &__left { + margin: auto 0; + color: var(--color-text-second); + } +} diff --git a/src/frontend/styles/layout.pcss b/src/frontend/styles/layout.pcss index d62fdc3..0ed573e 100644 --- a/src/frontend/styles/layout.pcss +++ b/src/frontend/styles/layout.pcss @@ -18,6 +18,6 @@ &__aside, &__content { - padding: 40px 0; + padding: var(--layout-padding-vertical) 0; } } diff --git a/src/frontend/styles/main.pcss b/src/frontend/styles/main.pcss index a7b887d..ad44985 100644 --- a/src/frontend/styles/main.pcss +++ b/src/frontend/styles/main.pcss @@ -3,6 +3,7 @@ @import url('layout.pcss'); @import url('components/header.pcss'); @import url('components/aside.pcss'); +@import url('components/writing.pcss'); body { font-family: system-ui, Helvetica, Arial, Verdana; diff --git a/src/frontend/styles/vars.pcss b/src/frontend/styles/vars.pcss index bd043fd..2f42b05 100644 --- a/src/frontend/styles/vars.pcss +++ b/src/frontend/styles/vars.pcss @@ -8,6 +8,7 @@ * Site layout sizes */ --layout-padding-horisontal: 40px; + --layout-padding-vertical: 40px; --layout-width-aside: 250px; --layout-width-main-col: 650px; diff --git a/src/models/page.js b/src/models/page.js index 1b0b1b8..a961a02 100644 --- a/src/models/page.js +++ b/src/models/page.js @@ -67,10 +67,10 @@ class Page { * @param {PageData} pageData */ set data(pageData) { - const {title, body, parent} = pageData; + const {body, parent} = pageData; - this.title = title || this.title; this.body = body || this.body; + this.title = this.extractTitleFromBody(); this._parent = parent || this._parent; } @@ -88,6 +88,16 @@ class Page { }; } + /** + * Extract first header from editor data + * @return {string} + */ + extractTitleFromBody() { + const headerBlock = this.body ? this.body.blocks.find(block => block.type === 'header') : ''; + + return headerBlock ? headerBlock.data.text : ''; + } + /** * Link given page as parent * diff --git a/src/routes/pages.js b/src/routes/pages.js index e1dd6a5..a9b9bae 100644 --- a/src/routes/pages.js +++ b/src/routes/pages.js @@ -7,7 +7,11 @@ const Pages = require('../controllers/pages'); * Create new page form */ router.get('/page/new', async (req, res) => { - res.render('pages/form'); + let pagesAvailable = await Pages.getAll(); + + res.render('pages/form', { + pagesAvailable + }); }); /** diff --git a/src/views/pages/form.twig b/src/views/pages/form.twig index 3ca987a..543cad0 100644 --- a/src/views/pages/form.twig +++ b/src/views/pages/form.twig @@ -1,6 +1,25 @@ {% extends 'layout.twig' %} {% block body %} +
+
+ + New Page at the + + + + Save + +
{% endblock %} diff --git a/test/models/page.js b/test/models/page.js index 0908c16..764da23 100644 --- a/test/models/page.js +++ b/test/models/page.js @@ -11,7 +11,7 @@ describe('Page model', () => { let {data} = page; expect(data._id).to.be.undefined; - expect(data.title).to.be.undefined; + expect(data.title).to.be.empty; expect(data.body).to.be.undefined; expect(data.parent).to.be.undefined; @@ -20,11 +20,23 @@ describe('Page model', () => { data = page.data; expect(data._id).to.be.undefined; - expect(data.title).to.be.undefined; + expect(data.title).to.be.empty; expect(data.body).to.be.undefined; expect(data.parent).to.be.undefined; - const initialData = {_id: 'page_id', title: 'Test page', body: 'Test page body'}; + const initialData = { + _id: 'page_id', + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + } + }; page = new Page(initialData); @@ -33,19 +45,27 @@ describe('Page model', () => { data = page.data; expect(data._id).to.equal(initialData._id); - expect(data.title).to.equal(initialData.title); - expect(data.body).to.equal(initialData.body); + expect(data.title).to.equal(initialData.body.blocks[0].data.text); + expect(data.body).to.deep.equal(initialData.body); expect(data.parent).to.be.undefined; expect(json._id).to.equal(initialData._id); - expect(json.title).to.equal(initialData.title); - expect(json.body).to.equal(initialData.body); + expect(json.title).to.equal(initialData.body.blocks[0].data.text); + expect(json.body).to.deep.equal(initialData.body); expect(json.parent).to.be.undefined; const update = { _id: 12345, - title: 'Test page', - body: 'Test page body' + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Updated page header' + } + } + ] + } }; page.data = update; @@ -53,19 +73,30 @@ describe('Page model', () => { data = page.data; expect(data._id).to.equal(initialData._id); - expect(data.title).to.equal(update.title); + expect(data.title).to.equal(update.body.blocks[0].data.text); expect(data.body).to.equal(update.body); expect(data.parent).to.be.undefined; }); it('Saving, updating and deleting model in the database', async () => { - const initialData = {title: 'Test page', body: 'Test page body'}; + const initialData = { + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + } + }; const page = new Page(initialData); let savedPage = await page.save(); expect(savedPage._id).not.be.undefined; - expect(savedPage.title).to.equal(initialData.title); + expect(savedPage.title).to.equal(initialData.body.blocks[0].data.text); expect(savedPage.body).to.equal(initialData.body); expect(page._id).not.be.undefined; @@ -73,9 +104,20 @@ describe('Page model', () => { expect(insertedPage._id).to.equal(page._id); expect(insertedPage.title).to.equal(page.title); - expect(insertedPage.body).to.equal(page.body); + expect(insertedPage.body).to.deep.equal(page.body); - const updateData = {title: 'Updated test page', body: 'Updated test page body'}; + const updateData = { + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Updated page header' + } + } + ] + } + }; page.data = updateData; await page.save(); @@ -85,8 +127,8 @@ describe('Page model', () => { const updatedPage = await pages.findOne({_id: page._id}); expect(updatedPage._id).to.equal(savedPage._id); - expect(updatedPage.title).to.equal(updateData.title); - expect(updatedPage.body).to.equal(updateData.body); + expect(updatedPage.title).to.equal(updateData.body.blocks[0].data.text); + expect(updatedPage.body).to.deep.equal(updateData.body); await page.destroy(); @@ -98,7 +140,18 @@ describe('Page model', () => { }); it('Static get method', async () => { - const initialData = {title: 'Test page', body: 'Test page body'}; + const initialData = { + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Test Page header' + } + } + ] + } + }; const page = new Page(initialData); const savedPage = await page.save(); @@ -108,16 +161,38 @@ describe('Page model', () => { const {data} = foundPage; expect(data._id).to.equal(savedPage._id); - expect(data.title).to.equal(initialData.title); - expect(data.body).to.equal(initialData.body); + expect(data.title).to.equal(initialData.body.blocks[0].data.text); + expect(data.body).to.deep.equal(initialData.body); await page.destroy(); }); it('Static getAll method', async () => { const pagesToSave = [ - new Page({title: 'Page 1', body: 'Page 1 body'}), - new Page({title: 'Page 2', body: 'Page 2 body'}) + new Page({ + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Page 1 header' + } + } + ] + } + }), + new Page({ + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Page 2 header' + } + } + ] + } + }) ]; const savedPages = await Promise.all(pagesToSave.map(page => page.save())); @@ -126,16 +201,42 @@ describe('Page model', () => { expect(foundPages.length).to.equal(2); foundPages.forEach((page, i) => { - expect(page.title).to.equal(pagesToSave[i].title); - expect(page.body).to.equal(pagesToSave[i].body); + expect(page.title).to.equal(pagesToSave[i].body.blocks[0].data.text); + expect(page.body).to.deep.equal(pagesToSave[i].body); }); }); it('Parent pages', async () => { - const parent = new Page({title: 'Parent page', body: 'Parent page body'}); + const parent = new Page( + { + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Parent page header' + } + } + ] + } + } + ); const {_id: parentId} = await parent.save(); - const child = new Page({title: 'Child page', body: 'Child page body'}); + const child = new Page( + { + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Child page header' + } + } + ] + } + } + ); child.parent = parent; @@ -144,8 +245,8 @@ describe('Page model', () => { const testedParent = await child.parent; expect(testedParent._id).to.equal(parentId); - expect(testedParent.title).to.equal(parent.title); - expect(testedParent.body).to.equal(parent.body); + expect(testedParent.title).to.equal(parent.body.blocks[0].data.text); + expect(testedParent.body).to.deep.equal(parent.body); const children = await parent.children; @@ -154,12 +255,31 @@ describe('Page model', () => { const testedChild = children.pop(); expect(testedChild._id).to.equal(childId); - expect(testedChild.title).to.equal(child.title); - expect(testedChild.body).to.equal(child.body); + expect(testedChild.title).to.equal(child.body.blocks[0].data.text); + expect(testedChild.body).to.deep.equal(child.body); expect(testedChild._parent).to.equal(child._parent); expect(testedChild._parent).to.equal(parent._id); parent.destroy(); child.destroy(); }); + + it('Extracting title from page body', async () => { + const pageData = { + body: { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + } + }; + + const page = new Page(pageData); + + expect(page.title).to.equal(pageData.body.blocks[0].data.text); + }); }); diff --git a/test/rest/pages.js b/test/rest/pages.js index 746ab70..cbb960c 100644 --- a/test/rest/pages.js +++ b/test/rest/pages.js @@ -15,12 +15,20 @@ describe('Pages REST: ', () => { }); it('Creating page', async () => { - const title = 'Test page'; - const body = 'Test page body'; + const body = { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + }; const res = await agent .put('/page') - .send({title, body}); + .send({body}); expect(res).to.have.status(200); expect(res).to.be.json; @@ -29,15 +37,15 @@ describe('Pages REST: ', () => { expect(success).to.be.true; expect(result._id).to.be.a('string'); - expect(result.title).to.equal(title); - expect(result.body).to.equal(body); + expect(result.title).to.equal(body.blocks[0].data.text); + expect(result.body).to.deep.equal(body); const createdPage = await model.get(result._id); expect(createdPage).not.be.null; expect(createdPage._id).to.equal(result._id); - expect(createdPage.title).to.equal(title); - expect(createdPage.body).to.equal(body); + expect(createdPage.title).to.equal(body.blocks[0].data.text); + expect(createdPage.body).to.deep.equal(body); createdPage.destroy(); }); @@ -53,16 +61,24 @@ describe('Pages REST: ', () => { const {success, error} = res.body; expect(success).to.be.false; - expect(error).to.equal('Invalid request format'); + expect(error).to.equal('Error: Some of required fields is missed'); }); it('Finding page', async () => { - const title = 'Test page'; - const body = 'Test page body'; + const body = { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + }; const put = await agent .put('/page') - .send({title, body}); + .send({body}); expect(put).to.have.status(200); expect(put).to.be.json; @@ -81,8 +97,8 @@ describe('Pages REST: ', () => { const foundPage = await model.get(_id); expect(foundPage._id).to.equal(_id); - expect(foundPage.title).to.equal(title); - expect(foundPage.body).to.equal(body); + expect(foundPage.title).to.equal(body.blocks[0].data.text); + expect(foundPage.body).to.deep.equal(body); foundPage.destroy(); }); @@ -100,24 +116,40 @@ describe('Pages REST: ', () => { }); it('Updating page', async () => { - const title = 'Test page'; - const body = 'Test page body'; + const body = { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + }; let res = await agent .put('/page') - .send({title, body}); + .send({body}); expect(res).to.have.status(200); expect(res).to.be.json; const {result: {_id}} = res.body; - const updatedTitle = 'Updated test page'; - const updatedBody = 'Updated test page body'; + const updatedBody = { + blocks: [ + { + type: 'header', + data: { + text: 'Updated page header' + } + } + ] + }; res = await agent .post(`/page/${_id}`) - .send({title: updatedTitle, body: updatedBody}); + .send({body: updatedBody}); expect(res).to.have.status(200); expect(res).to.be.json; @@ -126,26 +158,35 @@ describe('Pages REST: ', () => { expect(success).to.be.true; expect(result._id).to.equal(_id); - expect(result.title).not.equal(title); - expect(result.title).to.equal(updatedTitle); + expect(result.title).not.equal(body.blocks[0].data.text); + expect(result.title).to.equal(updatedBody.blocks[0].data.text); expect(result.body).not.equal(body); - expect(result.body).to.equal(updatedBody); + expect(result.body).to.deep.equal(updatedBody); const updatedPage = await model.get(_id); expect(updatedPage._id).to.equal(_id); - expect(updatedPage.title).not.equal(title); - expect(updatedPage.title).to.equal(updatedTitle); + expect(updatedPage.title).not.equal(body.blocks[0].data.text); + expect(updatedPage.title).to.equal(updatedBody.blocks[0].data.text); expect(updatedPage.body).not.equal(body); - expect(updatedPage.body).to.equal(updatedBody); + expect(updatedPage.body).to.deep.equal(updatedBody); updatedPage.destroy(); }); it('Updating page with not existing id', async () => { const res = await agent - . post('/page/not-existing-id') - .send({title: 'Updated title', body: 'Updated body'}); + .post('/page/not-existing-id') + .send({body: { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + }}); expect(res).to.have.status(400); expect(res).to.be.json; @@ -157,12 +198,20 @@ describe('Pages REST: ', () => { }); it('Removing page', async () => { - const title = 'Test page'; - const body = 'Test page body'; + const body = { + blocks: [ + { + type: 'header', + data: { + text: 'Page header' + } + } + ] + }; let res = await agent .put('/page') - .send({title, body}); + .send({body}); expect(res).to.have.status(200); expect(res).to.be.json; @@ -179,8 +228,8 @@ describe('Pages REST: ', () => { expect(success).to.be.true; expect(result._id).to.be.undefined; - expect(result.title).to.equal(title); - expect(result.body).to.equal(body); + expect(result.title).to.equal(body.blocks[0].data.text); + expect(result.body).to.deep.equal(body); const deletedPage = await model.get(_id); diff --git a/yarn.lock b/yarn.lock index 235cb64..4650296 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1453,6 +1453,10 @@ code-point-at@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" +codex.editor.header@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/codex.editor.header/-/codex.editor.header-2.0.5.tgz#fe0cc7d710b090e877499b7d9951ea36fddfbdc9" + codex.editor@^2.0.11: version "2.0.11" resolved "https://registry.yarnpkg.com/codex.editor/-/codex.editor-2.0.11.tgz#c45bb2c85888f96c129a6bfb01b0268f06768e15"