diff --git a/CHANGELOG.md b/CHANGELOG.md index 188b5fb..7c047bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.0-beta.3] - 2020-07-12 +### Added +- non-regular slide widths Support (#16) +- SSR Support (#13) +- Event optimisation with debounce +- Reorganize methods, and load only on need (like Events: Scroll, Resize, or on init) + +### Updated +- docs with new installation proccess + +### Moved +- rollup configs to seperate folders + ## [0.1.0-beta.2] - 2020-06-24 ### Added - Rollup init diff --git a/README.md b/README.md index d856278..10684cf 100644 --- a/README.md +++ b/README.md @@ -24,11 +24,6 @@ Please note that this lib is on very early stage. The idea behind this plugin is - You can set how many slides you want to display per current breakpoint (via css) - Fully responsive -## Know issues / limitless -- Partially not supported in IE -- Carousel not working properly with unknown slides width -- Touch/Drag is supported only on Mobiles/Tablets. - ## Usage There are two ways to use it. @@ -37,6 +32,7 @@ There are two ways to use it. ```js import Vue from 'vue' import VueSnap from 'vue-snap' +import 'vue-snap/dist/vue-snap.css' Vue.use(VueSnap) ``` @@ -45,6 +41,7 @@ Vue.use(VueSnap) ```js import { Carousel, Slide } from 'vue-snap' +import 'vue-snap/dist/vue-snap.css' export default { components: { diff --git a/build/rollup.config.base.js b/build/rollup.config.base.js new file mode 100644 index 0000000..85c9877 --- /dev/null +++ b/build/rollup.config.base.js @@ -0,0 +1,14 @@ +import vue from 'rollup-plugin-vue' +import babel from '@rollup/plugin-babel' +import cjs from '@rollup/plugin-commonjs' +import { terser } from 'rollup-plugin-terser' + +export default { + input: 'src/entry.js', + plugins: [ + vue(), + babel({ babelHelpers: 'bundled', exclude: 'node_modules/**', }), + cjs(), + terser() + ] +} diff --git a/build/rollup.config.browser.js b/build/rollup.config.browser.js new file mode 100644 index 0000000..047bbb2 --- /dev/null +++ b/build/rollup.config.browser.js @@ -0,0 +1,16 @@ +import base from './rollup.config.base' +import resolve from '@rollup/plugin-node-resolve' + +const config = Object.assign({}, base, { + output: { + exports: 'named', + name: 'VueSnap', + file: 'dist/vue-snap.js', + format: 'iife' + }, + external: [ 'vue' ] +}) + +config.plugins.push(resolve()) + +export default config diff --git a/build/rollup.config.es.js b/build/rollup.config.es.js new file mode 100644 index 0000000..b91ceb9 --- /dev/null +++ b/build/rollup.config.es.js @@ -0,0 +1,19 @@ +import base from './rollup.config.base' + +const config = Object.assign({}, base, { + output: { + exports: 'named', + name: 'VueSnap', + file: 'dist/vue-snap.esm.js', + format: 'esm', + globals: { + 'seamless-scroll-polyfill/dist/esm/Element.scrollBy': 'Element_scrollBy' + } + }, + external: [ + 'vue', + 'seamless-scroll-polyfill' + ] +}) + +export default config diff --git a/build/rollup.config.umd.js b/build/rollup.config.umd.js new file mode 100644 index 0000000..0fe665a --- /dev/null +++ b/build/rollup.config.umd.js @@ -0,0 +1,19 @@ +import base from './rollup.config.base' + +const config = Object.assign({}, base, { + output: { + exports: 'named', + name: 'VueSnap', + file: 'dist/vue-snap.umd.js', + format: 'umd', + globals: { + 'seamless-scroll-polyfill/dist/esm/Element.scrollBy': 'Element_scrollBy' + } + }, + external: [ + 'vue', + 'seamless-scroll-polyfill' + ] +}) + +export default config diff --git a/config/storybook/preview.js b/config/storybook/preview.js index 08a6db0..f5920ba 100644 --- a/config/storybook/preview.js +++ b/config/storybook/preview.js @@ -1,8 +1,3 @@ // Polyfill: Intersection observer (This is not a part of vue-snap) import 'intersection-observer' -// Common -import Vue from 'vue' -import VueSnap from '../../dist/vue-snap.min' - -Vue.use(VueSnap) diff --git a/src/assets/base.css b/dist/vue-snap.css similarity index 58% rename from src/assets/base.css rename to dist/vue-snap.css index eda2f7b..64f2f30 100644 --- a/src/assets/base.css +++ b/dist/vue-snap.css @@ -16,9 +16,8 @@ overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; - -webkit-overflow-scrolling: touch; - -ms-overflow-style: -ms-autohiding-scrollbar; scrollbar-width: none; + -webkit-overflow-scrolling: touch; -ms-overflow-style: none; } @@ -38,27 +37,18 @@ .vs-carousel__navigation { position: absolute; - top: 50%; - transform: translateY(-50%); - display: flex; - justify-content: center; - align-items: center; - min-width: 48px; - min-height: 48px; - background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 3L6 10L14 17' stroke='%232F2F2F' stroke-width='1'/%3E%3C/svg%3E%0A"); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center; - background-color: rgba(255, 255, 255, 0.8); - border: 0; + top: 0; + bottom: 0; + margin: auto; + width: 48px; + height: 48px; padding: 0; - outline: none; cursor: pointer; } .vs-carousel__navigation:hover, .vs-carousel__navigation:focus { - background-color: white; + border: none; } .vs-carousel__navigation--left { @@ -67,5 +57,4 @@ .vs-carousel__navigation--right { right: 0; - transform: rotate(180deg) translateY(50%); } diff --git a/dist/vue-snap.esm.js b/dist/vue-snap.esm.js new file mode 100644 index 0000000..9bf97e8 --- /dev/null +++ b/dist/vue-snap.esm.js @@ -0,0 +1 @@ +import{polyfill as t}from"seamless-scroll-polyfill/dist/esm/Element.scrollBy";import"core-js/modules/es.array.find-index";import"core-js/modules/es.array.map";import e from"lodash.debounce";var r="undefined"==typeof document||"undefined"==typeof window,i=!r;function n(t){return function(t){if(Array.isArray(t))return s(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return s(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=new Array(e);rt}))-1},calcNextWidth:function(t){var e=t>0?this.currentPage:this.currentPage+t;return this.slidesWidth[e].width*t},eventScroll:function(){this.calcCurrentPosition(),this.calcBounds()},eventResize:function(){this.calcWrapperWidth(),this.calcSlidesWidth(),this.calcCurrentPosition(),this.calcBounds(),this.calcMaxPages()},changeSlide:function(t){var e=-1===t&&this.boundLeft,r=1===t&&this.boundRight;if(!e&&!r){var i=this.calcNextWidth(t);this.scroll(i)}},scroll:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs.vsWrapper.scrollBy({left:t,behavior:"smooth"})}}};var c=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"vs-carousel"},[r("div",{ref:"vsWrapper",staticClass:"vs-carousel__wrapper"},[t._t("default")],2),t._v(" "),t.navigationArrows?t._t("navigation",[r("button",{directives:[{name:"show",rawName:"v-show",value:!t.boundLeft,expression:"!boundLeft"}],staticClass:"\n vs-carousel__navigation\n vs-carousel__navigation--left\n ",attrs:{"aria-label":"Slide left"},on:{click:function(e){return t.changeSlide(-1)}}},[t._v("\n ←\n ")]),t._v(" "),r("button",{directives:[{name:"show",rawName:"v-show",value:!t.boundRight,expression:"!boundRight"}],staticClass:"\n vs-carousel__navigation\n vs-carousel__navigation--right\n ",attrs:{"aria-label":"Slide right"},on:{click:function(e){return t.changeSlide(1)}}},[t._v("\n →\n ")])]):t._e()],2)};c._withStripped=!0;const l=o({render:c,staticRenderFns:[]},void 0,a,void 0,!1,void 0,!1,void 0,void 0,void 0);var d=function(){var t=this.$createElement;return(this._self._c||t)("div",{ref:"vsSlide",staticClass:"vs-carousel__slide",attrs:{tabindex:"0"}},[this._t("default")],2)};d._withStripped=!0;const h=o({render:d,staticRenderFns:[]},void 0,{},void 0,!1,void 0,!1,void 0,void 0,void 0);var u={install:function(t){t.component("carousel",l),t.component("slide",h)}};export default u;export{l as Carousel,h as Slide}; diff --git a/dist/vue-snap.js b/dist/vue-snap.js index 5d31a3b..3d2b458 100644 --- a/dist/vue-snap.js +++ b/dist/vue-snap.js @@ -1,390 +1 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('seamless-scroll-polyfill/dist/esm/Element.scrollBy')) : - typeof define === 'function' && define.amd ? define(['exports', 'seamless-scroll-polyfill/dist/esm/Element.scrollBy'], factory) : - (global = global || self, factory(global.VueSnap = {}, global.Element_scrollBy)); -}(this, (function (exports, Element_scrollBy) { 'use strict'; - - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - var script = { - props: { - /** - * Direction (by default Horizontal) - */ - vertical: { - type: Boolean, - default: false - }, - - /** - * Navigation Arrows - */ - navigation: { - type: Boolean, - default: true - }, - - /** - * Scroll per page, not per item - */ - scrollPage: { - type: Boolean, - default: false - } - }, - computed: { - getClass: function getClass() { - return ['vs-carousel', { - 'vs-carousel--vertical': this.vertical - }]; - } - }, - mounted: function mounted() { - this.scroll(); // Dirty hack to force rerender CSS Scroll Snap position - }, - methods: { - changeSlide: function changeSlide(direction) { - var _ref = this.scrollPage ? this.$refs.vsWrapper : this.$children[0].$el, - offsetWidth = _ref.offsetWidth, - offsetHeight = _ref.offsetHeight; - - if (this.vertical) { - this.scroll(0, direction * offsetHeight); - return; - } - - this.scroll(direction * offsetWidth, 0); - }, - scroll: function scroll() { - var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; - var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; - this.$refs.vsWrapper.scrollBy({ - left: x, - top: y, - behavior: 'smooth' - }); - } - } - }; - - function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) { - if (typeof shadowMode !== 'boolean') { - createInjectorSSR = createInjector; - createInjector = shadowMode; - shadowMode = false; - } - // Vue.extend constructor export interop. - const options = typeof script === 'function' ? script.options : script; - // render functions - if (template && template.render) { - options.render = template.render; - options.staticRenderFns = template.staticRenderFns; - options._compiled = true; - // functional template - if (isFunctionalTemplate) { - options.functional = true; - } - } - // scopedId - if (scopeId) { - options._scopeId = scopeId; - } - let hook; - if (moduleIdentifier) { - // server build - hook = function (context) { - // 2.3 injection - context = - context || // cached call - (this.$vnode && this.$vnode.ssrContext) || // stateful - (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional - // 2.2 with runInNewContext: true - if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { - context = __VUE_SSR_CONTEXT__; - } - // inject component styles - if (style) { - style.call(this, createInjectorSSR(context)); - } - // register component module identifier for async chunk inference - if (context && context._registeredComponents) { - context._registeredComponents.add(moduleIdentifier); - } - }; - // used by ssr in case component is cached and beforeCreate - // never gets called - options._ssrRegister = hook; - } - else if (style) { - hook = shadowMode - ? function (context) { - style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot)); - } - : function (context) { - style.call(this, createInjector(context)); - }; - } - if (hook) { - if (options.functional) { - // register for functional component in vue file - const originalRender = options.render; - options.render = function renderWithStyleInjection(h, context) { - hook.call(context); - return originalRender(h, context); - }; - } - else { - // inject component registration as beforeCreate hook - const existing = options.beforeCreate; - options.beforeCreate = existing ? [].concat(existing, hook) : [hook]; - } - } - return script; - } - - const isOldIE = typeof navigator !== 'undefined' && - /msie [6-9]\\b/.test(navigator.userAgent.toLowerCase()); - function createInjector(context) { - return (id, style) => addStyle(id, style); - } - let HEAD; - const styles = {}; - function addStyle(id, css) { - const group = isOldIE ? css.media || 'default' : id; - const style = styles[group] || (styles[group] = { ids: new Set(), styles: [] }); - if (!style.ids.has(id)) { - style.ids.add(id); - let code = css.source; - if (css.map) { - // https://developer.chrome.com/devtools/docs/javascript-debugging - // this makes source maps inside style tags work properly in Chrome - code += '\n/*# sourceURL=' + css.map.sources[0] + ' */'; - // http://stackoverflow.com/a/26603875 - code += - '\n/*# sourceMappingURL=data:application/json;base64,' + - btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + - ' */'; - } - if (!style.element) { - style.element = document.createElement('style'); - style.element.type = 'text/css'; - if (css.media) - style.element.setAttribute('media', css.media); - if (HEAD === undefined) { - HEAD = document.head || document.getElementsByTagName('head')[0]; - } - HEAD.appendChild(style.element); - } - if ('styleSheet' in style.element) { - style.styles.push(code); - style.element.styleSheet.cssText = style.styles - .filter(Boolean) - .join('\n'); - } - else { - const index = style.ids.size - 1; - const textNode = document.createTextNode(code); - const nodes = style.element.childNodes; - if (nodes[index]) - style.element.removeChild(nodes[index]); - if (nodes.length) - style.element.insertBefore(textNode, nodes[index]); - else - style.element.appendChild(textNode); - } - } - } - - /* script */ - const __vue_script__ = script; - - /* template */ - var __vue_render__ = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c( - "div", - { class: _vm.getClass }, - [ - _c( - "div", - { ref: "vsWrapper", staticClass: "vs-carousel__wrapper" }, - [_vm._t("default")], - 2 - ), - _vm._v(" "), - _vm.navigation - ? [ - _vm._t("navigation", [ - _c("button", { - ref: "vsNavigationLeft", - staticClass: - "\n vs-carousel__navigation\n vs-carousel__navigation--left\n ", - attrs: { "aria-label": "Slide left" }, - on: { - click: function($event) { - return _vm.changeSlide(-1) - } - } - }), - _vm._v(" "), - _c("button", { - ref: "vsNavigationRight", - staticClass: - "\n vs-carousel__navigation\n vs-carousel__navigation--right\n ", - attrs: { "aria-label": "Slide right" }, - on: { - click: function($event) { - return _vm.changeSlide(1) - } - } - }) - ]) - ] - : _vm._e() - ], - 2 - ) - }; - var __vue_staticRenderFns__ = []; - __vue_render__._withStripped = true; - - /* style */ - const __vue_inject_styles__ = function (inject) { - if (!inject) return - inject("data-v-80e179a2_0", { source: ".vs-carousel {\n position: relative;\n}\n.vs-carousel--vertical .vs-carousel__wrapper {\n overflow-x: hidden;\n overflow-y: scroll;\n scroll-snap-type: y mandatory;\n flex-direction: column;\n}\n.vs-carousel__wrapper {\n display: flex;\n height: 200px;\n overflow-x: scroll;\n overflow-y: hidden;\n scroll-snap-type: x mandatory;\n scroll-behavior: smooth;\n -webkit-overflow-scrolling: touch;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n scrollbar-width: none;\n -ms-overflow-style: none;\n}\n.vs-carousel__wrapper::-webkit-scrollbar {\n display: none;\n}\n.vs-carousel__slide {\n flex: 0 0 100%;\n height: 100%;\n scroll-snap-align: start;\n display: flex;\n justify-content: center;\n align-items: center;\n outline: none;\n}\n.vs-carousel__navigation {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: 48px;\n min-height: 48px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 3L6 10L14 17' stroke='%232F2F2F' stroke-width='1'/%3E%3C/svg%3E%0A\");\n background-repeat: no-repeat;\n background-size: 20px 20px;\n background-position: center;\n background-color: rgba(255, 255, 255, 0.8);\n border: 0;\n padding: 0;\n outline: none;\n cursor: pointer;\n}\n.vs-carousel__navigation:hover,\n.vs-carousel__navigation:focus {\n background-color: white;\n}\n.vs-carousel__navigation--left {\n left: 0;\n}\n.vs-carousel__navigation--right {\n right: 0;\n transform: rotate(180deg) translateY(50%);\n}\n", map: undefined, media: undefined }); - - }; - /* scoped */ - const __vue_scope_id__ = undefined; - /* module identifier */ - const __vue_module_identifier__ = undefined; - /* functional template */ - const __vue_is_functional_template__ = false; - /* style inject SSR */ - - /* style inject shadow dom */ - - - - const __vue_component__ = /*#__PURE__*/normalizeComponent( - { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ }, - __vue_inject_styles__, - __vue_script__, - __vue_scope_id__, - __vue_is_functional_template__, - __vue_module_identifier__, - false, - createInjector, - undefined, - undefined - ); - - /* script */ - - /* template */ - var __vue_render__$1 = function() { - var _vm = this; - var _h = _vm.$createElement; - var _c = _vm._self._c || _h; - return _c( - "div", - { - ref: "vsSlide", - staticClass: "vs-carousel__slide", - attrs: { tabindex: "0" } - }, - [_vm._t("default")], - 2 - ) - }; - var __vue_staticRenderFns__$1 = []; - __vue_render__$1._withStripped = true; - - /* style */ - const __vue_inject_styles__$1 = undefined; - /* scoped */ - const __vue_scope_id__$1 = undefined; - /* module identifier */ - const __vue_module_identifier__$1 = undefined; - /* functional template */ - const __vue_is_functional_template__$1 = false; - /* style inject */ - - /* style inject SSR */ - - /* style inject shadow dom */ - - - - const __vue_component__$1 = /*#__PURE__*/normalizeComponent( - { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 }, - __vue_inject_styles__$1, - {}, - __vue_scope_id__$1, - __vue_is_functional_template__$1, - __vue_module_identifier__$1, - false, - undefined, - undefined, - undefined - ); - - // Polyfill: SmoothScroll - - if (typeof window !== 'undefined' && typeof document !== 'undefined' && !('scrollBehavior' in document.documentElement.style)) { - Element_scrollBy.polyfill(); - } - - var install = function install(Vue) { - Vue.component('carousel', __vue_component__); - Vue.component('slide', __vue_component__$1); - }; - - var index = { - install: install - }; - - exports.Carousel = __vue_component__; - exports.Slide = __vue_component__$1; - exports.default = index; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); +var VueSnap=function(t){"use strict";const e=t=>.5*(1-Math.cos(Math.PI*t)),n=()=>(performance&&performance.now?performance:Date).now(),r=t=>{const o=(n()-t.timeStamp)/(t.duration||500);if(o>1)return t.method(t.targetX,t.targetY),void t.callback();const i=(t.timingFunc||e)(o),c=t.startX+(t.targetX-t.startX)*i,a=t.startY+(t.targetY-t.startY)*i;t.method(c,a),t.rafId=requestAnimationFrame(()=>{r(t)})};let o;const i=()=>(void 0===o&&(o=Element.prototype.scroll||Element.prototype.scrollTo||function(t,e){this.scrollLeft=t,this.scrollTop=e}),o),c=(t,e)=>{const o=(e.left||0)+t.scrollLeft,c=(e.top||0)+t.scrollTop;return((t,e)=>{const o=i().bind(t);if(void 0===e.left&&void 0===e.top)return;const c=t.scrollLeft,a=t.scrollTop,{left:u=c,top:s=a}=e;if("smooth"!==e.behavior)return o(u,s);const f=()=>{window.removeEventListener("wheel",d),window.removeEventListener("touchmove",d)},l={timeStamp:n(),duration:e.duration,startX:c,startY:a,targetX:u,targetY:s,rafId:0,method:o,timingFunc:e.timingFunc,callback:f},d=()=>{cancelAnimationFrame(l.rafId),f()};window.addEventListener("wheel",d,{passive:!0,once:!0}),window.addEventListener("touchmove",d,{passive:!0,once:!0}),r(l)})(t,{...e,left:o,top:c})},a=t=>{Element.prototype.scrollBy=function(){const[e=0,n=0]=arguments;if("number"==typeof e&&"number"==typeof n)return c(this,{left:e,top:n});if(Object(e)!==e)throw new TypeError("Failed to execute 'scrollBy' on 'Element': parameter 1 ('options') is not an object.");return c(this,{...e,...t})}};var u="undefined"==typeof document||"undefined"==typeof window,s=!u;u||"scrollBehavior"in document.documentElement.style||a();var f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function l(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&n.path)}},n.exports),n.exports}var d=function(t){return t&&t.Math==Math&&t},p=d("object"==typeof globalThis&&globalThis)||d("object"==typeof window&&window)||d("object"==typeof self&&self)||d("object"==typeof f&&f)||Function("return this")(),h=function(t){try{return!!t()}catch(t){return!0}},v=!h((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),y={}.propertyIsEnumerable,m=Object.getOwnPropertyDescriptor,g={f:m&&!y.call({1:2},1)?function(t){var e=m(this,t);return!!e&&e.enumerable}:y},b=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},w={}.toString,S=function(t){return w.call(t).slice(8,-1)},_="".split,O=h((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==S(t)?_.call(t,""):Object(t)}:Object,j=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},E=function(t){return O(j(t))},W=function(t){return"object"==typeof t?null!==t:"function"==typeof t},P=function(t,e){if(!W(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!W(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!W(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!W(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},x={}.hasOwnProperty,T=function(t,e){return x.call(t,e)},C=p.document,A=W(C)&&W(C.createElement),L=function(t){return A?C.createElement(t):{}},I=!v&&!h((function(){return 7!=Object.defineProperty(L("div"),"a",{get:function(){return 7}}).a})),R=Object.getOwnPropertyDescriptor,$={f:v?R:function(t,e){if(t=E(t),e=P(e,!0),I)try{return R(t,e)}catch(t){}if(T(t,e))return b(!g.f.call(t,e),t[e])}},M=function(t){if(!W(t))throw TypeError(String(t)+" is not an object");return t},F=Object.defineProperty,N={f:v?F:function(t,e,n){if(M(t),e=P(e,!0),M(n),I)try{return F(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},k=v?function(t,e,n){return N.f(t,e,b(1,n))}:function(t,e,n){return t[e]=n,t},B=function(t,e){try{k(p,t,e)}catch(n){p[t]=e}return e},X=p["__core-js_shared__"]||B("__core-js_shared__",{}),z=Function.toString;"function"!=typeof X.inspectSource&&(X.inspectSource=function(t){return z.call(t)});var V,D,Y,q=X.inspectSource,U=p.WeakMap,G="function"==typeof U&&/native code/.test(q(U)),K=l((function(t){(t.exports=function(t,e){return X[t]||(X[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),H=0,J=Math.random(),Q=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++H+J).toString(36)},Z=K("keys"),tt=function(t){return Z[t]||(Z[t]=Q(t))},et={},nt=p.WeakMap;if(G){var rt=new nt,ot=rt.get,it=rt.has,ct=rt.set;V=function(t,e){return ct.call(rt,t,e),e},D=function(t){return ot.call(rt,t)||{}},Y=function(t){return it.call(rt,t)}}else{var at=tt("state");et[at]=!0,V=function(t,e){return k(t,at,e),e},D=function(t){return T(t,at)?t[at]:{}},Y=function(t){return T(t,at)}}var ut,st={set:V,get:D,has:Y,enforce:function(t){return Y(t)?D(t):V(t,{})},getterFor:function(t){return function(e){var n;if(!W(e)||(n=D(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},ft=l((function(t){var e=st.get,n=st.enforce,r=String(String).split("String");(t.exports=function(t,e,o,i){var c=!!i&&!!i.unsafe,a=!!i&&!!i.enumerable,u=!!i&&!!i.noTargetGet;"function"==typeof o&&("string"!=typeof e||T(o,"name")||k(o,"name",e),n(o).source=r.join("string"==typeof e?e:"")),t!==p?(c?!u&&t[e]&&(a=!0):delete t[e],a?t[e]=o:k(t,e,o)):a?t[e]=o:B(e,o)})(Function.prototype,"toString",(function(){return"function"==typeof this&&e(this).source||q(this)}))})),lt=p,dt=function(t){return"function"==typeof t?t:void 0},pt=function(t,e){return arguments.length<2?dt(lt[t])||dt(p[t]):lt[t]&<[t][e]||p[t]&&p[t][e]},ht=Math.ceil,vt=Math.floor,yt=function(t){return isNaN(t=+t)?0:(t>0?vt:ht)(t)},mt=Math.min,gt=function(t){return t>0?mt(yt(t),9007199254740991):0},bt=Math.max,wt=Math.min,St=function(t){return function(e,n,r){var o,i=E(e),c=gt(i.length),a=function(t,e){var n=yt(t);return n<0?bt(n+e,0):wt(n,e)}(r,c);if(t&&n!=n){for(;c>a;)if((o=i[a++])!=o)return!0}else for(;c>a;a++)if((t||a in i)&&i[a]===n)return t||a||0;return!t&&-1}},_t={includes:St(!0),indexOf:St(!1)}.indexOf,Ot=function(t,e){var n,r=E(t),o=0,i=[];for(n in r)!T(et,n)&&T(r,n)&&i.push(n);for(;e.length>o;)T(r,n=e[o++])&&(~_t(i,n)||i.push(n));return i},jt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Et=jt.concat("length","prototype"),Wt={f:Object.getOwnPropertyNames||function(t){return Ot(t,Et)}},Pt={f:Object.getOwnPropertySymbols},xt=pt("Reflect","ownKeys")||function(t){var e=Wt.f(M(t)),n=Pt.f;return n?e.concat(n(t)):e},Tt=function(t,e){for(var n=xt(e),r=N.f,o=$.f,i=0;im;m++)if((c||m in h)&&(d=v(l=h[m],m,p),t))if(e)b[m]=d;else if(d)switch(t){case 3:return!0;case 5:return l;case 6:return m;case 2:Kt.call(b,l)}else if(o)return!1;return i?-1:r||o?o:b}},Jt={forEach:Ht(0),map:Ht(1),filter:Ht(2),some:Ht(3),every:Ht(4),find:Ht(5),findIndex:Ht(6)},Qt=Object.keys||function(t){return Ot(t,jt)},Zt=v?Object.defineProperties:function(t,e){M(t);for(var n,r=Qt(e),o=r.length,i=0;o>i;)N.f(t,n=r[i++],e[n]);return t},te=pt("document","documentElement"),ee=tt("IE_PROTO"),ne=function(){},re=function(t){return" - -