UNPKG

css-animator

Version:

Animate elements using CSS classes with support for Angular 2+

1,044 lines (1,005 loc) 45.3 kB
(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define("css-animator/builder", [], factory); else if(typeof exports === 'object') exports["css-animator/builder"] = factory(); else root["css-animator/builder"] = factory(); })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./dist/builder/animation_builder.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./dist/builder/animation_builder.js": /*!*******************************************!*\ !*** ./dist/builder/animation_builder.js ***! \*******************************************/ /*! exports provided: AnimationMode, AnimationBuilder */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationMode", function() { return AnimationMode; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AnimationBuilder", function() { return AnimationBuilder; }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ "./node_modules/tslib/tslib.es6.js"); var AnimationMode; (function (AnimationMode) { AnimationMode[AnimationMode["Animate"] = 0] = "Animate"; AnimationMode[AnimationMode["Show"] = 1] = "Show"; AnimationMode[AnimationMode["Hide"] = 2] = "Hide"; })(AnimationMode || (AnimationMode = {})); ; var AnimationBuilder = /** @class */ (function () { // Public Methods function AnimationBuilder() { this.animationOptions = Object.assign({}, AnimationBuilder.defaults); this.defaultOptions = Object.assign({}, this.animationOptions); this.classes = []; this.activeClasses = new Map(); this.listeners = new Map(); this.timeouts = new Map(); this.styles = new Map(); this.log('AnimationBuilder created.'); } AnimationBuilder.prototype.show = function (element) { return this.animate(element, AnimationMode.Show); }; AnimationBuilder.prototype.hide = function (element) { return this.animate(element, AnimationMode.Hide); }; AnimationBuilder.prototype.stop = function (element, reset) { if (reset === void 0) { reset = true; } this.removeTimeouts(element); this.removeListeners(element); if (reset) this.reset(element, false); return Promise.resolve(element); }; AnimationBuilder.prototype.animate = function (element, mode) { var _this = this; if (mode === void 0) { mode = AnimationMode.Animate; } if (AnimationBuilder.disabled || this.animationOptions.disabled) { return this.animateDisabled(element, mode); } if (mode === AnimationMode.Show) { this.hideElement(element); } return new Promise(function (resolve, reject) { _this.removeTimeouts(element); var delay = setTimeout(function () { _this.reset(element, true, false, true); _this.registerAnimationListeners(element, mode, resolve, reject); _this.saveStyle(element); _this.saveClasses(element, mode); _this.pinElement(element, mode); _this.nextFrame(function () { _this.showElement(element, mode); _this.applyProperties(element, mode); }); }, _this.animationOptions.delay); _this.addTimeout(element, delay, reject); _this.log("Timeout " + delay + " registered for element", element); }); }; AnimationBuilder.prototype.reset = function (element, removePending, rejectTimeouts, rejectListeners) { if (removePending === void 0) { removePending = true; } if (rejectTimeouts === void 0) { rejectTimeouts = false; } if (rejectListeners === void 0) { rejectListeners = false; } if (removePending) { this.removeTimeouts(element, rejectTimeouts); this.removeListeners(element, rejectListeners); } this.removeStyles(element); this.removeClasses(element); }; AnimationBuilder.prototype.dispose = function () { this.timeouts.forEach(function (refs) { var e_1, _a; try { for (var refs_1 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(refs), refs_1_1 = refs_1.next(); !refs_1_1.done; refs_1_1 = refs_1.next()) { var t = refs_1_1.value; clearTimeout(t.timeout); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (refs_1_1 && !refs_1_1.done && (_a = refs_1.return)) _a.call(refs_1); } finally { if (e_1) throw e_1.error; } } }); this.listeners.forEach(function (refs, el) { var e_2, _a; try { for (var refs_2 = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__values"])(refs), refs_2_1 = refs_2.next(); !refs_2_1.done; refs_2_1 = refs_2.next()) { var l = refs_2_1.value; el.removeEventListener(l.eventName, l.handler); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (refs_2_1 && !refs_2_1.done && (_a = refs_2.return)) _a.call(refs_2); } finally { if (e_2) throw e_2.error; } } }); this.classes = []; this.styles = new Map(); this.timeouts = new Map(); this.listeners = new Map(); }; AnimationBuilder.prototype.addAnimationClass = function (name) { if (this.classes.indexOf(name) === -1) { this.classes.push(name); } return this; }; AnimationBuilder.prototype.removeAnimationClass = function (name) { var index = this.classes.indexOf(name); if (index !== -1) { this.classes.splice(index, 1); } return this; }; Object.defineProperty(AnimationBuilder, "DEBUG", { // Public Static Methods get: function () { return AnimationBuilder._DEBUG; }, set: function (debug) { AnimationBuilder._DEBUG = debug; }, enumerable: false, configurable: true }); Object.defineProperty(AnimationBuilder, "disabled", { get: function () { return AnimationBuilder._disabled; }, set: function (disabled) { AnimationBuilder._disabled = disabled; }, enumerable: false, configurable: true }); Object.defineProperty(AnimationBuilder, "defaults", { get: function () { return AnimationBuilder._defaults; }, enumerable: false, configurable: true }); // Private Methods AnimationBuilder.prototype.animateDisabled = function (element, mode) { if (mode === AnimationMode.Show) { this.showElement(element, mode); } else if (mode === AnimationMode.Hide) { this.hideElement(element, mode); } return Promise.resolve(element); }; AnimationBuilder.prototype.log = function () { var values = []; for (var _i = 0; _i < arguments.length; _i++) { values[_i] = arguments[_i]; } if (AnimationBuilder.DEBUG) { console.log.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spreadArray"])(['css-animator:'], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(values))); } }; AnimationBuilder.prototype.nextFrame = function (fn) { AnimationBuilder.raf(function () { AnimationBuilder.raf(fn); }); }; AnimationBuilder.prototype.camelCase = function (input) { return input.toLowerCase().replace(/-(.)/g, function (match, group) { return group.toUpperCase(); }); }; AnimationBuilder.prototype.hideElement = function (element, mode) { if (this.animationOptions.useVisibility) { element.style.visibility = 'hidden'; return; } element.setAttribute('hidden', ''); }; AnimationBuilder.prototype.showElement = function (element, mode) { if (this.animationOptions.pin && mode === AnimationMode.Show) { element.style.visibility = 'visible'; } if (this.animationOptions.useVisibility) { element.style.visibility = 'visible'; return; } element.removeAttribute('hidden'); }; AnimationBuilder.prototype.pinElement = function (element, mode) { if (!this.animationOptions.pin) return; if (mode === AnimationMode.Show) { element.style.visibility = 'hidden'; } if (!this.animationOptions.useVisibility) { this.showElement(element); } var position = this.getPosition(element); element.style.position = this.animationOptions.fixed ? 'fixed' : 'absolute'; element.style.top = position.top + "px"; element.style.left = position.left + "px"; element.style.width = position.width + "px"; element.style.height = position.height + "px"; element.style.margin = '0px'; }; AnimationBuilder.prototype.getPosition = function (element) { var rect = element.getBoundingClientRect(); var cs = window.getComputedStyle(element); var left = element.offsetLeft; var top = element.offsetTop; var width = rect.width - parseFloat(cs.paddingLeft) - parseFloat(cs.paddingRight) - parseFloat(cs.borderLeftWidth) - parseFloat(cs.borderRightWidth); var height = rect.height - parseFloat(cs.paddingTop) - parseFloat(cs.paddingBottom) - parseFloat(cs.borderTopWidth) - parseFloat(cs.borderBottomWidth); if (this.animationOptions.fixed) { left = rect.left + window.scrollX; top = rect.top + window.scrollY; } return { left: left, top: top, width: width, height: height }; }; AnimationBuilder.prototype.registerAnimationListeners = function (element, mode, resolve, reject) { var _this = this; var animationStartEvent = this.animationStartEvent(element); var animationEndEvent = this.animationEndEvent(element); var startHandler; element.addEventListener(animationStartEvent, startHandler = function () { _this.log("Animation start handler fired for element", element); element.removeEventListener(animationStartEvent, startHandler); return startHandler; }); this.log("Registered animation start listener for element", element); var endHandler; element.addEventListener(animationEndEvent, endHandler = function () { _this.log("Animation end handler fired for element", element); element.removeEventListener(animationEndEvent, endHandler); _this.removeListeners(element, false); _this.reset(element, true, false, false); if (mode === AnimationMode.Hide) _this.hideElement(element); if (mode === AnimationMode.Show) _this.showElement(element); resolve(element); return endHandler; }); this.log("Registered animation end listener for element", element); this.addListener(element, animationStartEvent, startHandler); this.addListener(element, animationEndEvent, endHandler, reject); }; AnimationBuilder.prototype.addTimeout = function (element, timeout, reject) { if (!this.timeouts.has(element)) { this.timeouts.set(element, []); } this.timeouts.get(element).push({ timeout: timeout, reject: reject, }); }; AnimationBuilder.prototype.addListener = function (element, eventName, handler, reject) { if (!this.listeners.has(element)) { this.listeners.set(element, []); } var classes = Object.assign({}, this.classes); this.listeners.get(element).push({ eventName: eventName, handler: handler, reject: reject, classes: classes, }); }; AnimationBuilder.prototype.removeListeners = function (element, reject) { var _this = this; if (reject === void 0) { reject = false; } if (!this.listeners.has(element)) return; this.listeners.get(element) .forEach(function (ref) { element.removeEventListener(ref.eventName, ref.handler); _this.log("Listener " + ref.eventName + " removed for element", element); if (reject && _this.animationOptions.reject && ref.reject) ref.reject('animation_aborted'); }); this.listeners.delete(element); }; AnimationBuilder.prototype.removeTimeouts = function (element, reject) { var _this = this; if (reject === void 0) { reject = false; } if (!this.timeouts.has(element)) return; this.timeouts.get(element) .forEach(function (ref) { clearTimeout(ref.timeout); _this.log("Timeout " + ref.timeout + " removed for element", element); if (reject && _this.animationOptions.reject && ref.reject) ref.reject('animation_aborted'); }); this.timeouts.delete(element); }; AnimationBuilder.prototype.animationEndEvent = function (element) { var el = document.createElement('endAnimationElement'); var animations = { animation: 'animationend', OAnimation: 'oAnimationEnd', MozAnimation: 'animationend', WebkitAnimation: 'webkitAnimationEnd', }; for (var animation in animations) { if (el.style[animation] !== undefined) { return animations[animation]; } } return null; }; AnimationBuilder.prototype.animationStartEvent = function (element) { var el = document.createElement('startAnimationElement'); var animations = { animation: 'animationstart', OAnimation: 'oAnimationStart', MozAnimation: 'animationstart', WebkitAnimation: 'webkitAnimationStart', }; for (var animation in animations) { if (el.style[animation] !== undefined) { return animations[animation]; } } return null; }; AnimationBuilder.prototype.applyProperties = function (element, mode) { this.applyClasses(element, mode); this.applyStyles(element, mode); }; AnimationBuilder.prototype.saveStyle = function (element) { var styles = {}; for (var style in element.style) { styles[style] = element.style.getPropertyValue(style); } this.styles.set(element, styles); }; AnimationBuilder.prototype.applyStyles = function (element, mode) { this.applyFillMode(element); this.applyTimingFunction(element); this.applyPlayState(element); this.applyDirection(element); this.applyDuration(element); this.applyIterationCount(element); }; AnimationBuilder.prototype.removeStyles = function (element) { if (!this.styles.has(element)) return; var styles = this.styles.get(element); element.removeAttribute('style'); for (var style in styles) { element.style.setProperty(style, styles[style]); } this.styles.delete(element); }; AnimationBuilder.prototype.saveClasses = function (element, mode) { var classes = this.classes.slice(0); switch (mode) { case AnimationMode.Show: classes.push('animated-show'); break; case AnimationMode.Hide: classes.push('animated-hide'); break; } classes.push('animated', this.animationOptions.type); this.activeClasses.set(element, classes); }; AnimationBuilder.prototype.applyClasses = function (element, mode) { var _a; var active = this.activeClasses.get(element) || []; (_a = element.classList).add.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spreadArray"])(['animated'], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(active))); }; AnimationBuilder.prototype.removeClasses = function (element) { var _a; var active = this.activeClasses.get(element) || []; (_a = element.classList).remove.apply(_a, Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__spreadArray"])(['animated', 'animated-show', 'animated-hide'], Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__read"])(active))); this.activeClasses.delete(element); }; AnimationBuilder.prototype.applyStyle = function (element, prop, value) { var el = document.createElement('checkStyle'); var styles = { standard: this.camelCase(prop), webkit: this.camelCase("-webkit-" + prop), mozilla: this.camelCase("-moz-" + prop), opera: this.camelCase("-o-" + prop), explorer: this.camelCase("-ie-" + prop), }; for (var style in styles) { if (!styles.hasOwnProperty(style)) continue; if (el.style[styles[style]] !== undefined) { element.style[styles[style]] = value === undefined || value === null ? null : value; break; } } return this; }; Object.defineProperty(AnimationBuilder.prototype, "defaults", { // Getters and Setters get: function () { return this.defaultOptions; }, set: function (defaults) { this.defaultOptions = defaults; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setDefaults = function (defaults) { this.defaults = defaults; return this; }; Object.defineProperty(AnimationBuilder.prototype, "options", { get: function () { return this.animationOptions; }, set: function (options) { this.animationOptions = options; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setOptions = function (options) { Object.assign(this.options, options); return this; }; Object.defineProperty(AnimationBuilder.prototype, "disabled", { get: function () { return this.animationOptions.disabled; }, set: function (disabled) { this.animationOptions.disabled = disabled; }, enumerable: false, configurable: true }); Object.defineProperty(AnimationBuilder.prototype, "reject", { get: function () { return this.animationOptions.reject; }, set: function (reject) { this.animationOptions.reject = reject; }, enumerable: false, configurable: true }); Object.defineProperty(AnimationBuilder.prototype, "pin", { get: function () { return this.animationOptions.pin; }, set: function (pin) { this.animationOptions.pin = pin; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setPin = function (pin) { this.pin = pin; return this; }; Object.defineProperty(AnimationBuilder.prototype, "useVisibility", { get: function () { return this.animationOptions.useVisibility; }, set: function (useVisibility) { this.animationOptions.useVisibility = useVisibility; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setUseVisibility = function (useVisibility) { this.useVisibility = useVisibility; return this; }; Object.defineProperty(AnimationBuilder.prototype, "type", { get: function () { return this.animationOptions.type; }, set: function (type) { this.animationOptions.type = type; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setType = function (type) { this.type = type; return this; }; Object.defineProperty(AnimationBuilder.prototype, "fillMode", { get: function () { return this.animationOptions.fillMode; }, set: function (fillMode) { this.animationOptions.fillMode = fillMode; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setFillMode = function (fillMode) { this.fillMode = fillMode; return this; }; AnimationBuilder.prototype.applyFillMode = function (element, fillMode) { this.applyStyle(element, 'animation-fill-mode', fillMode || this.animationOptions.fillMode); return this; }; Object.defineProperty(AnimationBuilder.prototype, "timingFunction", { get: function () { return this.animationOptions.timingFunction; }, set: function (timingFunction) { this.animationOptions.timingFunction = timingFunction; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setTimingFunction = function (timingFunction) { this.timingFunction = timingFunction; return this; }; AnimationBuilder.prototype.applyTimingFunction = function (element, timingFunction) { this.applyStyle(element, 'animation-timing-function', timingFunction || this.animationOptions.timingFunction); return this; }; Object.defineProperty(AnimationBuilder.prototype, "playState", { get: function () { return this.animationOptions.playState; }, set: function (playState) { this.animationOptions.playState = playState; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setPlayState = function (playState) { this.playState = playState; return this; }; AnimationBuilder.prototype.applyPlayState = function (element, playState) { this.applyStyle(element, 'animation-play-state', playState || this.animationOptions.playState); return this; }; Object.defineProperty(AnimationBuilder.prototype, "direction", { get: function () { return this.animationOptions.direction; }, set: function (direction) { this.animationOptions.direction = direction; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setDirection = function (direction) { this.direction = direction; return this; }; AnimationBuilder.prototype.applyDirection = function (element, direction) { this.applyStyle(element, 'animation-direction', direction || this.animationOptions.direction); return this; }; Object.defineProperty(AnimationBuilder.prototype, "duration", { get: function () { return this.animationOptions.duration; }, set: function (duration) { this.animationOptions.duration = duration; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setDuration = function (duration) { this.duration = duration; return this; }; AnimationBuilder.prototype.applyDuration = function (element, duration) { this.applyStyle(element, 'animation-duration', (duration || this.animationOptions.duration) + "ms"); return this; }; Object.defineProperty(AnimationBuilder.prototype, "delay", { get: function () { return this.animationOptions.delay; }, set: function (delay) { this.animationOptions.delay = delay; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setDelay = function (delay) { this.delay = delay; return this; }; AnimationBuilder.prototype.applyDelayAsStyle = function (element, delay) { this.applyStyle(element, 'animation-delay', (delay || this.animationOptions.delay) + "ms"); return this; }; Object.defineProperty(AnimationBuilder.prototype, "iterationCount", { get: function () { return this.animationOptions.iterationCount; }, set: function (iterationCount) { this.animationOptions.iterationCount = iterationCount; }, enumerable: false, configurable: true }); AnimationBuilder.prototype.setIterationCount = function (iterationCount) { this.iterationCount = iterationCount; return this; }; AnimationBuilder.prototype.applyIterationCount = function (element, iterationCount) { this.applyStyle(element, 'animation-iteration-count', iterationCount || this.animationOptions.iterationCount); return this; }; AnimationBuilder._DEBUG = false; AnimationBuilder._disabled = false; AnimationBuilder._defaults = { disabled: false, fixed: false, reject: true, useVisibility: false, pin: true, type: 'bounce', fillMode: 'none', timingFunction: 'ease', playState: 'running', direction: 'normal', duration: 1000, delay: 0, iterationCount: 1, }; AnimationBuilder.raf = window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : setTimeout; return AnimationBuilder; }()); /***/ }), /***/ "./node_modules/tslib/tslib.es6.js": /*!*****************************************!*\ !*** ./node_modules/tslib/tslib.es6.js ***! \*****************************************/ /*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__extends", function() { return __extends; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__assign", function() { return __assign; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__rest", function() { return __rest; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__decorate", function() { return __decorate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__param", function() { return __param; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__metadata", function() { return __metadata; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__awaiter", function() { return __awaiter; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__generator", function() { return __generator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__createBinding", function() { return __createBinding; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__exportStar", function() { return __exportStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__values", function() { return __values; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__read", function() { return __read; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spread", function() { return __spread; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArrays", function() { return __spreadArrays; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__spreadArray", function() { return __spreadArray; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__await", function() { return __await; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncGenerator", function() { return __asyncGenerator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncDelegator", function() { return __asyncDelegator; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__asyncValues", function() { return __asyncValues; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__makeTemplateObject", function() { return __makeTemplateObject; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importStar", function() { return __importStar; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } /***/ }) /******/ }); }); //# sourceMappingURL=builder.js.map