{"version":3,"file":"vendors-4fbbf958.4e202c72d209411713eb.bundle.js","mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;ACvcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://frontend/./node_modules/aurelia-animator-css/dist/native-modules/aurelia-animator-css.js","webpack://frontend/./node_modules/aurelia-api/dist/native-modules/aurelia-api.js"],"sourcesContent":["\n\nimport { animationEvent, TemplatingEngine } from 'aurelia-templating';\nimport { DOM } from 'aurelia-pal';\n\nexport var CssAnimator = function () {\n function CssAnimator() {\n \n\n this.useAnimationDoneClasses = false;\n this.animationEnteredClass = 'au-entered';\n this.animationLeftClass = 'au-left';\n this.isAnimating = false;\n\n this.verifyKeyframesExist = true;\n }\n\n CssAnimator.prototype._addMultipleEventListener = function _addMultipleEventListener(el, s, fn) {\n var evts = s.split(' ');\n for (var i = 0, ii = evts.length; i < ii; ++i) {\n el.addEventListener(evts[i], fn, false);\n }\n };\n\n CssAnimator.prototype._removeMultipleEventListener = function _removeMultipleEventListener(el, s, fn) {\n var evts = s.split(' ');\n for (var i = 0, ii = evts.length; i < ii; ++i) {\n el.removeEventListener(evts[i], fn, false);\n }\n };\n\n CssAnimator.prototype._getElementAnimationDelay = function _getElementAnimationDelay(element) {\n var styl = DOM.getComputedStyle(element);\n var prop = void 0;\n var delay = void 0;\n\n if (styl.getPropertyValue('animation-delay')) {\n prop = 'animation-delay';\n } else if (styl.getPropertyValue('-webkit-animation-delay')) {\n prop = '-webkit-animation-delay';\n } else if (styl.getPropertyValue('-moz-animation-delay')) {\n prop = '-moz-animation-delay';\n } else {\n return 0;\n }\n\n delay = styl.getPropertyValue(prop);\n delay = Number(delay.replace(/[^\\d\\.]/g, ''));\n\n return delay * 1000;\n };\n\n CssAnimator.prototype._getElementAnimationNames = function _getElementAnimationNames(element) {\n var styl = DOM.getComputedStyle(element);\n var prefix = void 0;\n\n if (styl.getPropertyValue('animation-name')) {\n prefix = '';\n } else if (styl.getPropertyValue('-webkit-animation-name')) {\n prefix = '-webkit-';\n } else if (styl.getPropertyValue('-moz-animation-name')) {\n prefix = '-moz-';\n } else {\n return [];\n }\n\n var animationNames = styl.getPropertyValue(prefix + 'animation-name');\n return animationNames ? animationNames.split(' ') : [];\n };\n\n CssAnimator.prototype._performSingleAnimate = function _performSingleAnimate(element, className) {\n var _this = this;\n\n this._triggerDOMEvent(animationEvent.animateBegin, element);\n\n return this.addClass(element, className, true).then(function (result) {\n _this._triggerDOMEvent(animationEvent.animateActive, element);\n\n if (result !== false) {\n return _this.removeClass(element, className, true).then(function () {\n _this._triggerDOMEvent(animationEvent.animateDone, element);\n });\n }\n\n return false;\n }).catch(function () {\n _this._triggerDOMEvent(animationEvent.animateTimeout, element);\n });\n };\n\n CssAnimator.prototype._triggerDOMEvent = function _triggerDOMEvent(eventType, element) {\n var evt = DOM.createCustomEvent(eventType, { bubbles: true, cancelable: true, detail: element });\n DOM.dispatchEvent(evt);\n };\n\n CssAnimator.prototype._animationChangeWithValidKeyframe = function _animationChangeWithValidKeyframe(animationNames, prevAnimationNames) {\n var newAnimationNames = animationNames.filter(function (name) {\n return prevAnimationNames.indexOf(name) === -1;\n });\n\n if (newAnimationNames.length === 0) {\n return false;\n }\n\n if (!this.verifyKeyframesExist) {\n return true;\n }\n\n var keyframesRuleType = window.CSSRule.KEYFRAMES_RULE || window.CSSRule.MOZ_KEYFRAMES_RULE || window.CSSRule.WEBKIT_KEYFRAMES_RULE;\n\n var styleSheets = document.styleSheets;\n\n try {\n for (var i = 0; i < styleSheets.length; ++i) {\n var cssRules = null;\n\n try {\n cssRules = styleSheets[i].cssRules;\n } catch (e) {}\n\n if (!cssRules) {\n continue;\n }\n\n for (var j = 0; j < cssRules.length; ++j) {\n var cssRule = cssRules[j];\n\n if (cssRule.type === keyframesRuleType) {\n if (newAnimationNames.indexOf(cssRule.name) !== -1) {\n return true;\n }\n }\n }\n }\n } catch (e) {}\n\n return false;\n };\n\n CssAnimator.prototype.animate = function animate(element, className) {\n var _this2 = this;\n\n if (Array.isArray(element)) {\n return Promise.all(element.map(function (el) {\n return _this2._performSingleAnimate(el, className);\n }));\n }\n\n return this._performSingleAnimate(element, className);\n };\n\n CssAnimator.prototype.runSequence = function runSequence(animations) {\n var _this3 = this;\n\n this._triggerDOMEvent(animationEvent.sequenceBegin, null);\n\n return animations.reduce(function (p, anim) {\n return p.then(function () {\n return _this3.animate(anim.element, anim.className);\n });\n }, Promise.resolve(true)).then(function () {\n _this3._triggerDOMEvent(animationEvent.sequenceDone, null);\n });\n };\n\n CssAnimator.prototype._stateAnim = function _stateAnim(element, direction, doneClass) {\n var _this4 = this;\n\n var auClass = 'au-' + direction;\n var auClassActive = auClass + '-active';\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Begin'], element);\n\n if (_this4.useAnimationDoneClasses) {\n classList.remove(_this4.animationEnteredClass);\n classList.remove(_this4.animationLeftClass);\n }\n\n classList.add(auClass);\n var prevAnimationNames = _this4._getElementAnimationNames(element);\n\n var _animStart = void 0;\n var animHasStarted = false;\n _this4._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this4.isAnimating = true;\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Active'], element);\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart);\n }, false);\n\n var _animEnd = void 0;\n _this4._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n evAnimEnd.stopPropagation();\n\n classList.remove(auClassActive);\n classList.remove(auClass);\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd);\n\n if (_this4.useAnimationDoneClasses && doneClass !== undefined && doneClass !== null) {\n classList.add(doneClass);\n }\n\n _this4.isAnimating = false;\n _this4._triggerDOMEvent(animationEvent[direction + 'Done'], element);\n\n resolve(true);\n }, false);\n\n var parent = element.parentElement;\n var attrib = 'data-animator-pending' + direction;\n\n var cleanupAnimation = function cleanupAnimation() {\n var animationNames = _this4._getElementAnimationNames(element);\n if (!_this4._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(auClassActive);\n classList.remove(auClass);\n\n _this4._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd);\n _this4._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart);\n\n _this4._triggerDOMEvent(animationEvent[direction + 'Timeout'], element);\n resolve(false);\n }\n parent && parent.setAttribute(attrib, +(parent.getAttribute(attrib) || 1) - 1);\n };\n\n if (parent !== null && parent !== undefined && (parent.classList.contains('au-stagger') || parent.classList.contains('au-stagger-' + direction))) {\n var offset = +(parent.getAttribute(attrib) || 0);\n parent.setAttribute(attrib, offset + 1);\n var delay = _this4._getElementAnimationDelay(parent) * offset;\n _this4._triggerDOMEvent(animationEvent.staggerNext, element);\n\n setTimeout(function () {\n classList.add(auClassActive);\n cleanupAnimation();\n }, delay);\n } else {\n classList.add(auClassActive);\n cleanupAnimation();\n }\n });\n };\n\n CssAnimator.prototype.enter = function enter(element) {\n return this._stateAnim(element, 'enter', this.animationEnteredClass);\n };\n\n CssAnimator.prototype.leave = function leave(element) {\n return this._stateAnim(element, 'leave', this.animationLeftClass);\n };\n\n CssAnimator.prototype.removeClass = function removeClass(element, className) {\n var _this5 = this;\n\n var suppressEvents = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];\n\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n if (!classList.contains(className) && !classList.contains(className + '-add')) {\n resolve(false);\n return;\n }\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassBegin, element);\n }\n\n if (classList.contains(className + '-add')) {\n classList.remove(className + '-add');\n classList.add(className);\n }\n\n classList.remove(className);\n var prevAnimationNames = _this5._getElementAnimationNames(element);\n\n var _animStart2 = void 0;\n var animHasStarted = false;\n _this5._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2 = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this5.isAnimating = true;\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassActive, element);\n }\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart2);\n }, false);\n\n var _animEnd2 = void 0;\n _this5._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2 = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n if (!element.classList.contains(className + '-remove')) {\n resolve(true);\n }\n\n evAnimEnd.stopPropagation();\n\n classList.remove(className);\n\n classList.remove(className + '-remove');\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd2);\n\n _this5.isAnimating = false;\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassDone, element);\n }\n\n resolve(true);\n }, false);\n\n classList.add(className + '-remove');\n\n var animationNames = _this5._getElementAnimationNames(element);\n if (!_this5._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(className + '-remove');\n classList.remove(className);\n\n _this5._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd2);\n _this5._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart2);\n\n if (suppressEvents !== true) {\n _this5._triggerDOMEvent(animationEvent.removeClassTimeout, element);\n }\n\n resolve(false);\n }\n });\n };\n\n CssAnimator.prototype.addClass = function addClass(element, className) {\n var _this6 = this;\n\n var suppressEvents = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2];\n\n return new Promise(function (resolve, reject) {\n var classList = element.classList;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassBegin, element);\n }\n\n if (classList.contains(className + '-remove')) {\n classList.remove(className + '-remove');\n classList.remove(className);\n }\n\n var _animStart3 = void 0;\n var animHasStarted = false;\n _this6._addMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3 = function animStart(evAnimStart) {\n if (evAnimStart.target !== element) {\n return;\n }\n animHasStarted = true;\n _this6.isAnimating = true;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassActive, element);\n }\n\n evAnimStart.stopPropagation();\n\n evAnimStart.target.removeEventListener(evAnimStart.type, _animStart3);\n }, false);\n\n var _animEnd3 = void 0;\n _this6._addMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3 = function animEnd(evAnimEnd) {\n if (!animHasStarted) {\n return;\n }\n if (evAnimEnd.target !== element) {\n return;\n }\n\n if (!element.classList.contains(className + '-add')) {\n resolve(true);\n }\n\n evAnimEnd.stopPropagation();\n\n classList.add(className);\n\n classList.remove(className + '-add');\n\n evAnimEnd.target.removeEventListener(evAnimEnd.type, _animEnd3);\n\n _this6.isAnimating = false;\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassDone, element);\n }\n\n resolve(true);\n }, false);\n\n var prevAnimationNames = _this6._getElementAnimationNames(element);\n\n classList.add(className + '-add');\n\n var animationNames = _this6._getElementAnimationNames(element);\n if (!_this6._animationChangeWithValidKeyframe(animationNames, prevAnimationNames)) {\n classList.remove(className + '-add');\n classList.add(className);\n\n _this6._removeMultipleEventListener(element, 'webkitAnimationEnd animationend', _animEnd3);\n _this6._removeMultipleEventListener(element, 'webkitAnimationStart animationstart', _animStart3);\n\n if (suppressEvents !== true) {\n _this6._triggerDOMEvent(animationEvent.addClassTimeout, element);\n }\n\n resolve(false);\n }\n });\n };\n\n return CssAnimator;\n}();\n\nexport function configure(config, callback) {\n var animator = config.container.get(CssAnimator);\n config.container.get(TemplatingEngine).configureAnimator(animator);\n if (typeof callback === 'function') {\n callback(animator);\n }\n}","'use strict';\n\nexports.__esModule = true;\nexports.Endpoint = exports.Config = exports.Rest = undefined;\n\nvar _dec, _class3;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexports.configure = configure;\n\nvar _extend = require('extend');\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _aureliaPath = require('aurelia-path');\n\nvar _aureliaFetchClient = require('aurelia-fetch-client');\n\nvar _aureliaDependencyInjection = require('aurelia-dependency-injection');\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n\n\nvar Rest = exports.Rest = function () {\n function Rest(httpClient, endpoint, useTraditionalUriTemplates) {\n \n\n this.defaults = {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n };\n\n this.client = httpClient;\n this.endpoint = endpoint;\n this.useTraditionalUriTemplates = !!useTraditionalUriTemplates;\n }\n\n Rest.prototype.request = function request(method, path, body, options, responseOutput) {\n var requestOptions = (0, _extend2.default)(true, { headers: {} }, this.defaults || {}, options || {}, { method: method, body: body });\n var contentType = requestOptions.headers['Content-Type'] || requestOptions.headers['content-type'];\n\n if ((typeof body === 'undefined' ? 'undefined' : _typeof(body)) === 'object' && body !== null && contentType) {\n requestOptions.body = /^application\\/(.+\\+)?json/.test(contentType.toLowerCase()) ? JSON.stringify(body) : (0, _aureliaPath.buildQueryString)(body);\n }\n\n return this.client.fetch(path, requestOptions).then(function (response) {\n if (response.status >= 200 && response.status < 400) {\n if (responseOutput) {\n responseOutput.response = response;\n }\n\n return response.json().catch(function () {\n return null;\n });\n }\n\n throw response;\n });\n };\n\n Rest.prototype.find = function find(resource, idOrCriteria, options, responseOutput) {\n return this.request('GET', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), undefined, options, responseOutput);\n };\n\n Rest.prototype.findOne = function findOne(resource, id, criteria, options, responseOutput) {\n return this.request('GET', getRequestPath(resource, this.useTraditionalUriTemplates, id, criteria), undefined, options, responseOutput);\n };\n\n Rest.prototype.post = function post(resource, body, options, responseOutput) {\n return this.request('POST', resource, body, options, responseOutput);\n };\n\n Rest.prototype.update = function update(resource, idOrCriteria, body, options, responseOutput) {\n return this.request('PUT', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), body, options, responseOutput);\n };\n\n Rest.prototype.updateOne = function updateOne(resource, id, criteria, body, options, responseOutput) {\n return this.request('PUT', getRequestPath(resource, this.useTraditionalUriTemplates, id, criteria), body, options, responseOutput);\n };\n\n Rest.prototype.patch = function patch(resource, idOrCriteria, body, options, responseOutput) {\n return this.request('PATCH', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), body, options, responseOutput);\n };\n\n Rest.prototype.patchOne = function patchOne(resource, id, criteria, body, options, responseOutput) {\n return this.request('PATCH', getRequestPath(resource, this.useTraditionalUriTemplates, id, criteria), body, options, responseOutput);\n };\n\n Rest.prototype.destroy = function destroy(resource, idOrCriteria, options, responseOutput) {\n return this.request('DELETE', getRequestPath(resource, this.useTraditionalUriTemplates, idOrCriteria), undefined, options, responseOutput);\n };\n\n Rest.prototype.destroyOne = function destroyOne(resource, id, criteria, options, responseOutput) {\n return this.request('DELETE', getRequestPath(resource, this.useTraditionalUriTemplates, id, criteria), undefined, options, responseOutput);\n };\n\n Rest.prototype.create = function create(resource, body, options, responseOutput) {\n return this.post(resource, body, options, responseOutput);\n };\n\n return Rest;\n}();\n\nfunction getRequestPath(resource, traditional, idOrCriteria, criteria) {\n var hasSlash = resource.slice(-1) === '/';\n\n if (typeof idOrCriteria === 'string' || typeof idOrCriteria === 'number') {\n resource = '' + (0, _aureliaPath.join)(resource, String(idOrCriteria)) + (hasSlash ? '/' : '');\n } else {\n criteria = idOrCriteria;\n }\n\n if ((typeof criteria === 'undefined' ? 'undefined' : _typeof(criteria)) === 'object' && criteria !== null) {\n resource += '?' + (0, _aureliaPath.buildQueryString)(criteria, traditional);\n } else if (criteria) {\n resource += '' + (hasSlash ? '' : '/') + criteria + (hasSlash ? '/' : '');\n }\n\n return resource;\n}\n\nvar Config = exports.Config = function () {\n function Config() {\n \n\n this.endpoints = {};\n }\n\n Config.prototype.registerEndpoint = function registerEndpoint(name, configureMethod, defaults, restOptions) {\n var _this = this;\n\n var newClient = new _aureliaFetchClient.HttpClient();\n var useTraditionalUriTemplates = void 0;\n\n if (restOptions !== undefined) {\n useTraditionalUriTemplates = restOptions.useTraditionalUriTemplates;\n }\n this.endpoints[name] = new Rest(newClient, name, useTraditionalUriTemplates);\n\n if (defaults !== undefined) {\n this.endpoints[name].defaults = defaults;\n }\n\n if (typeof configureMethod === 'function') {\n newClient.configure(function (newClientConfig) {\n return configureMethod(newClientConfig.withDefaults(_this.endpoints[name].defaults));\n });\n\n this.endpoints[name].defaults = newClient.defaults;\n\n return this;\n }\n\n if (typeof configureMethod !== 'string' && !this.defaultBaseUrl) {\n return this;\n }\n\n if (this.defaultBaseUrl && typeof configureMethod !== 'string' && typeof configureMethod !== 'function') {\n newClient.configure(function (configure) {\n configure.withBaseUrl(_this.defaultBaseUrl);\n });\n\n return this;\n }\n\n newClient.configure(function (configure) {\n configure.withBaseUrl(configureMethod);\n });\n\n return this;\n };\n\n Config.prototype.getEndpoint = function getEndpoint(name) {\n if (!name) {\n return this.defaultEndpoint || null;\n }\n\n return this.endpoints[name] || null;\n };\n\n Config.prototype.endpointExists = function endpointExists(name) {\n return !!this.endpoints[name];\n };\n\n Config.prototype.setDefaultEndpoint = function setDefaultEndpoint(name) {\n this.defaultEndpoint = this.getEndpoint(name);\n\n return this;\n };\n\n Config.prototype.setDefaultBaseUrl = function setDefaultBaseUrl(baseUrl) {\n this.defaultBaseUrl = baseUrl;\n\n return this;\n };\n\n Config.prototype.configure = function configure(config) {\n var _this2 = this;\n\n if (config.defaultBaseUrl) {\n this.defaultBaseUrl = config.defaultBaseUrl;\n }\n\n config.endpoints.forEach(function (endpoint) {\n _this2.registerEndpoint(endpoint.name, endpoint.endpoint, endpoint.config);\n\n if (endpoint.default) {\n _this2.setDefaultEndpoint(endpoint.name);\n }\n });\n\n if (config.defaultEndpoint) {\n this.setDefaultEndpoint(config.defaultEndpoint);\n }\n\n return this;\n };\n\n return Config;\n}();\n\nfunction configure(frameworkConfig, configOrConfigure) {\n var config = frameworkConfig.container.get(Config);\n\n if (typeof configOrConfigure === 'function') {\n configOrConfigure(config);\n\n return;\n }\n\n config.configure(configOrConfigure);\n}\n\nvar Endpoint = exports.Endpoint = (_dec = (0, _aureliaDependencyInjection.resolver)(), _dec(_class3 = function () {\n function Endpoint(key) {\n \n\n this._key = key;\n }\n\n Endpoint.prototype.get = function get(container) {\n return container.get(Config).getEndpoint(this._key);\n };\n\n Endpoint.of = function of(key) {\n return new Endpoint(key);\n };\n\n return Endpoint;\n}()) || _class3);"],"names":[],"sourceRoot":""}