ember-data-source 2.13.0.beta.3 → 2.13.0.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dist/globals/ember-data.js +10 -6
- data/dist/globals/ember-data.min.js +6 -6
- data/dist/globals/ember-data.prod.js +10 -6
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b475ab63696b1c01a3acbea23489c6b7b736153
|
4
|
+
data.tar.gz: f4f56675a94da57c9d94635f15d93f946f751dfa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0fdb6cb5872981dc555b5e7e91aa105b9361e317659ddd9789342ce3d112bcd2933542839aad7541f007193951e997bb51fd95893b113147bac98598feffa07
|
7
|
+
data.tar.gz: 7c74966b1eb6d5e26aac3a359e197d2c5f36b20bb8e6a23e841cc63672cd3c06c473b3c55486385a09a4cfdcacfe0e2493491fbfc4af620c02c3ff4ee9f37ff5
|
data/dist/globals/ember-data.js
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* @copyright Copyright 2011-2017 Tilde Inc. and contributors.
|
7
7
|
* Portions Copyright 2011 LivingSocial Inc.
|
8
8
|
* @license Licensed under MIT license (see license.js)
|
9
|
-
* @version 2.13.0-beta.
|
9
|
+
* @version 2.13.0-beta.4
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -2413,7 +2413,10 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
|
|
2413
2413
|
_classCallCheck(this, InternalModel);
|
2414
2414
|
|
2415
2415
|
this.id = id;
|
2416
|
-
|
2416
|
+
|
2417
|
+
// this ensure ordered set can quickly identify this as unique
|
2418
|
+
this[_ember.default.GUID_KEY] = InternalModelReferenceId++ + 'internal-model';
|
2419
|
+
|
2417
2420
|
this.store = store;
|
2418
2421
|
this.modelName = modelName;
|
2419
2422
|
this._loadingPromise = null;
|
@@ -11389,6 +11392,8 @@ define('ember-data/-private/system/store/container-instance-cache', ['exports',
|
|
11389
11392
|
function ContainerInstanceCache(owner, store) {
|
11390
11393
|
_classCallCheck(this, ContainerInstanceCache);
|
11391
11394
|
|
11395
|
+
this.isDestroying = false;
|
11396
|
+
this.isDestroyed = false;
|
11392
11397
|
this._owner = owner;
|
11393
11398
|
this._store = store;
|
11394
11399
|
this._namespaces = {
|
@@ -11461,11 +11466,10 @@ define('ember-data/-private/system/store/container-instance-cache', ['exports',
|
|
11461
11466
|
};
|
11462
11467
|
|
11463
11468
|
ContainerInstanceCache.prototype.destroy = function destroy() {
|
11469
|
+
this.isDestroying = true;
|
11464
11470
|
this.destroyCache(this._namespaces.adapter);
|
11465
11471
|
this.destroyCache(this._namespaces.serializer);
|
11466
|
-
this.
|
11467
|
-
this._store = null;
|
11468
|
-
this._owner = null;
|
11472
|
+
this.isDestroyed = true;
|
11469
11473
|
};
|
11470
11474
|
|
11471
11475
|
ContainerInstanceCache.prototype.toString = function toString() {
|
@@ -17155,7 +17159,7 @@ define("ember-data/version", ["exports"], function (exports) {
|
|
17155
17159
|
"use strict";
|
17156
17160
|
|
17157
17161
|
exports.__esModule = true;
|
17158
|
-
exports.default = "2.13.0-beta.
|
17162
|
+
exports.default = "2.13.0-beta.4";
|
17159
17163
|
});
|
17160
17164
|
define("ember-inflector", ["module", "exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (module, exports, _ember, _system) {
|
17161
17165
|
"use strict";
|
@@ -1,6 +1,6 @@
|
|
1
|
-
(function(){"use strict";var e,t,r,i,a;!function(n){function o(){var e=Object.create(null);return e.__=void 0,delete e.__,e}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function d(e,t,r,i){this.id=b++,this.name=e,this.deps=!t.length&&r.length?_:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function l(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){for(var i=y[e]||y[e+"/index"];i&&i.isAlias;)i=y[i.name];return i||u(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function h(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),i=t.split("/"),a=i.slice(0,-1),n=0,o=r.length;n<o;n++){var s=r[n];if(".."===s){if(0===a.length)throw new Error("Cannot access parent module of root");a.pop()}else{if("."===s)continue;a.push(s)}}return a.join("/")}function p(e){return!(!y[e]&&!y[e+"/index"])}var f=(n.heimdall,{loader:e,define:t,requireModule:r,require:i,requirejs:a});a=i=r=function(e){for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&f.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=f[t])}};var m;m=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var y=o(),v=o(),b=0,_=["require","exports","module"];d.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},d.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),this.makeDefaultExport(),this.module.exports},d.prototype.unsee=function(){this.state="new",this.module={exports:{}}},d.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},d.prototype._reify=function(){for(var e=this.reified.slice(),t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}return e},d.prototype.findDeps=function(e){if("new"===this.state){this.state="pending";for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],a=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,a.exports=this.module.exports):"require"===i?a.exports=this.makeRequire():"module"===i?a.exports=this.module:a.module=c(h(i,this.name),this.name,e)}}},d.prototype.makeRequire=function(){var e=this.name,t=function(t){return i(h(t,e))};return t.default=t,t.has=function(t){return p(h(t,e))},t},t=function(e,t,r){var i=y[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),m(t)||(r=t,t=[]),y[e]=r instanceof l?new d(r.name,t,r,!0):new d(e,t,r,!1))},t.alias=function(e){return new l(e)},a.entries=a._eak_seen=y,a.has=p,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){a.entries=a._eak_seen=y=o(),v=o()},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),i("foo/main"),i.unsee("foo/bar"),a.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.__esModule=!0,e.RESTAdapter=e.JSONAPIAdapter=void 0,e.JSONAPIAdapter=t.default,e.RESTAdapter=r.default}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,a){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(a,e);case"queryRecord":return this.urlForQueryRecord(a,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var i=void 0,a=[],n=r(this,"host"),o=this.urlPrefix();return e&&(i=this.pathForType(e))&&a.push(i),t&&a.push(encodeURIComponent(t)),o&&a.unshift(o),a=a.join("/"),!n&&a&&"/"!==a.charAt(0)&&(a="/"+a),a},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var i=r(this,"host"),a=r(this,"namespace");if(i&&"/"!==i||(i=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+i+e:t+"/"+e;var n=[];return i&&n.push(i),a&&n.push(a),n.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){e.__esModule=!0;var i=t.default.Namespace.create({VERSION:r.default,name:"DS"});t.default.libraries&&t.default.libraries.registerCoreLibrary("Ember Data",i.VERSION),e.default=i}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t.default.assert.apply(t.default,arguments)}function i(){return t.default.debug.apply(t.default,arguments)}function a(){return t.default.deprecate.apply(t.default,arguments)}function n(){return t.default.info.apply(t.default,arguments)}function o(){return t.default.runInDebug.apply(t.default,arguments)}function s(e){return e()}function d(){return t.default.warn.apply(t.default,arguments)}function l(){return t.default.debugSeal.apply(t.default,arguments)}function u(e,r){return e.__isMixin?e.__mixin.detect(r.PrototypeMixin):(t.default.MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r))}function c(e,t,i){var a=i.modelName,n=e.modelName,o=t.key,s=t.type;r("You cannot add a record of modelClass '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s+"' allowed)",u(e.store.modelFor(s),i.modelClass))}e.__esModule=!0,e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.instrument=s,e.warn=d,e.debugSeal=l,e.assertPolymorphicType=c}),t("ember-data/-private/ext/date",["exports","ember","ember-data/-private/debug"],function(e,t,r){e.__esModule=!0,e.parseDate=void 0,t.default.Date=t.default.Date||{};var i=Date.parse,a=[1,4,5,6,7,10,11],n=e.parseDate=function(e){var t=void 0,r=void 0,n=0;if(r=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2}):?(?:(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=a[s];++s)r[o]=+r[o]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,"Z"!==r[8]&&void 0!==r[9]&&(n=60*r[10]+r[11],"+"===r[9]&&(n=0-n)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+n,r[6],r[7])}else t=i?i(e):NaN;return t};t.default.Date.parse=function(e){return n(e)},(t.default.EXTEND_PROTOTYPES===!0||t.default.EXTEND_PROTOTYPES.Date)&&(Date.parse=n)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.__esModule=!0,e.default=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}e.__esModule=!0,e.default=t(function(e){return e&&void 0===e.nodeType?e:void 0}("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t.default)}e.__esModule=!0,e.default=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e.__esModule=!0,e.default=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,i){function a(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",i.RESTAdapter),e.register("adapter:-json-api",i.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),a(e,"service:store")||e.register("service:store",t.default)}e.__esModule=!0,e.default=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e.__esModule=!0,e.default=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports","ember-data/-private/debug"],function(e,t){function r(e){(e.lookup?e:e.container).lookup("service:store"),a(e.application.constructor.initializers)}function i(e){return o.indexOf(e)!==-1}function a(e){Object.keys(e).map(function(t){return e[t]}).filter(function(e){return!i(e.name)}).forEach(n)}function n(e){i(e.before),i(e.after)}e.__esModule=!0,e.default=r;var o=["data-adapter","injectStore","transforms","store"]}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,i){e.__esModule=!0,e.RESTSerializer=e.JSONSerializer=e.JSONAPISerializer=void 0,e.JSONAPISerializer=t.default,e.JSONSerializer=r.default,e.RESTSerializer=i.default}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t.default;for(var i in e)r[i]=e[i];return r}e.__esModule=!0,e.default=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:e+""}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e.__esModule=!0,e.default=t.default}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){e.__esModule=!0;var i=t.default.String.capitalize,a=t.default.String.underscore,n=t.default.assert,o=t.default.get;e.default=t.default.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r.default&&r.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,n=this;return o(e,"attributes").forEach(function(e,o){if(r++>n.attributeLimit)return!1;var s=i(a(o).replace("_"," "));t.push({name:o,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);i&&(t=i[1])}}return n("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:o(e,"id")};return e.eachAttribute(function(a){if(r++>t.attributeLimit)return!1;i[a]=o(e,a)}),i},getRecordKeywords:function(e){var r=[],i=t.default.A(["id"]);return e.eachAttribute(function(e){return i.push(e)}),i.forEach(function(t){return r.push(o(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var i=t.default.A(),a=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return a.push(e)});var n=this;return a.forEach(function(a){var o=function(){r(n.wrapRecord(e))};t.default.addObserver(e,a,o),i.push(function(){t.default.removeObserver(e,a,o)})}),function(){i.forEach(function(e){return e()})}}})}),t("ember-data/-private/system/diff-array",["exports"],function(e){function t(e,t){for(var r=e.length,i=t.length,a=Math.min(r,i),n=null,o=0;o<a;o++)if(e[o]!==t[o]){n=o;break}null===n&&i!==r&&(n=a);var s=0,d=0;if(null!==n){for(var l=a-n,u=1;u<=a;u++)if(e[r-u]!==t[i-u]){l=u-1;break}s=i-l-n,d=r-l-n}return{firstChangeIndex:n,addedCount:s,removedCount:d}}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e.__esModule=!0,e.default=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/identity-map",["exports","ember-data/-private/system/internal-model-map"],function(e,t){e.__esModule=!0;var r=function(){function e(){this._map=Object.create(null)}return e.prototype.retrieve=function(e){var r=this._map[e];return r||(r=this._map[e]=new t.default(e)),r},e.prototype.clear=function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}},e}();e.default=r}),t("ember-data/-private/system/internal-model-map",["exports","ember-data/-private/debug","ember-data/-private/system/model/internal-model"],function(e,t,r){e.__esModule=!0;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),a=function(){function e(e){this.modelName=e,this._idToModel=Object.create(null),this._models=[],this._metadata=null}return e.prototype.get=function(e){return this._idToModel[e]},e.prototype.has=function(e){return!!this._idToModel[e]},e.prototype.set=function(e,t){this._idToModel[e]=t},e.prototype.add=function(e,t){t&&(this._idToModel[t]=e),this._models.push(e)},e.prototype.remove=function(e,t){t&&delete this._idToModel[t];var r=this._models.indexOf(e);r!==-1&&this._models.splice(r,1)},e.prototype.contains=function(e){return this._models.indexOf(e)!==-1},e.prototype.clear=function(){if(this._models){var e=this._models;this._models=[];for(var t=0;t<e.length;t++){e[t].unloadRecord()}}this._metadata=null},e.prototype.destroy=function(){this._store=null,this._modelClass=null},i(e,[{key:"idToRecord",get:function(){return this._idToModel}},{key:"length",get:function(){return this._models.length}},{key:"models",get:function(){return this._models}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("InternalModelMap.type is no longer available")}}]),e}();e.default=a}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t.default.Array.detect(e))return!0;var r=t.default.typeOf(e);return"array"===r||void 0!==e.length&&"object"===r}e.__esModule=!0,e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/diff-array"],function(e,t,r,i,a,n){e.__esModule=!0;var o=t.default.get,s=t.default.set;e.default=t.default.Object.extend(t.default.MutableArray,t.default.Evented,{init:function(){this._super.apply(this,arguments),this.isLoaded=!1,this.length=0,this.promise=null,this.meta=this.meta||null,this.isPolymorphic=this.isPolymorphic||!1,this.relationship=this.relationship||null,this.currentState=[],this.flushCanonical(!1)},objectAt:function(e){var t=this.currentState[e];if(void 0!==t)return t.getRecord()},flushCanonical:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if((0,a._objectIsAlive)(this)){var t=this.canonicalState,r=this.currentState.filter(function(e){return e.isNew()&&t.indexOf(e)===-1});t=t.concat(r);var i=(0,n.default)(this.currentState,t);null!==i.firstChangeIndex&&(this.arrayContentWillChange(i.firstChangeIndex,i.removedCount,i.addedCount),this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(i.firstChangeIndex,i.removedCount,i.addedCount),e&&i.addedCount>0&&this.relationship.notifyHasManyChanged())}},internalReplace:function(e,t,r){r||(r=[]),this.arrayContentWillChange(e,t,r.length),this.currentState.splice.apply(this.currentState,[e,t].concat(r)),this.set("length",this.currentState.length),this.arrayContentDidChange(e,t,r.length)},internalRemoveRecords:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i=void 0;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(i)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},loadingRecordsCount:function(e){this._loadingRecordsCount=e},loadedRecord:function(){0===--this._loadingRecordsCount&&(s(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+o(this,"type"),a=t.default.RSVP.all(this.invoke("save"),r).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return i.PromiseArray.create({promise:a})},createRecord:function(e){var t=o(this,"store"),r=o(this,"type"),i=t.createRecord(r.modelName,e);return this.pushObject(i),i}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,i,a){e.__esModule=!0,e.Errors=e.attr=e.RootState=void 0,e.RootState=i.default,e.attr=r.default,e.Errors=a.default,e.default=t.default}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){e.__esModule=!0;var i=t.default.get,a=t.default.set,n=t.default.isEmpty,o=t.default.makeArray,s=t.default.MapWithDefault;e.default=t.default.ArrayProxy.extend(t.default.Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t.default.computed(function(){return s.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return i(this,"errorsByAttributeName").get(e)},messages:t.default.computed.mapBy("content","message"),content:t.default.computed(function(){return t.default.A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t.default.computed.not("length").readOnly(),add:function(e,t){var r=i(this,"isEmpty");this._add(e,t),r&&!i(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),i(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=o(t),a=new Array(i.length),n=0;n<i.length;n++){var s=i[n],d=r.findBy("message",s);a[n]=d?d:{attribute:e,message:s}}return a},remove:function(e){i(this,"isEmpty")||(this._remove(e),i(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!i(this,"isEmpty")){a(this,"content",this.rejectBy("attribute",e)),i(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){i(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!i(this,"isEmpty")){var e=i(this,"errorsByAttributeName"),r=t.default.A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t.default.ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/system/ordered-set","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,a,n,o,s,d,l,u){function c(e){return S[e]||(S[e]=e.split("."))}function h(e){return k[e]||(k[e]=c(e)[0])}function p(e){for(var t=0;t<e.length;++t){var r=e[t].record;if(r&&!r.get("isDestroyed")&&!r.get("isDestroying"))return!1}return!0}e.__esModule=!0;var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),m=t.default.get,y=t.default.set,v=t.default.copy,b=t.default.Error,_=t.default.inspect,g=t.default.isEmpty,R=t.default.isEqual,A=t.default.setOwner,M=t.default.RSVP,F=t.default.RSVP.Promise,z=t.default.assign||t.default.merge,T=new o.default,k=new o.default,S=new o.default,x=1,E=1,P=function(){function e(e,t,r,i){this.id=t,this._internalId=x++,this.store=r,this.modelName=e,this._loadingPromise=null,this._record=null,this._isDestroyed=!1,this.isError=!1,this._isUpdatingRecordArrays=!1,this._isDematerializing=!1,this.resetRecord(),i&&(this.__data=i),this._modelClass=null,this.__deferredTriggers=null,this.__recordArrays=null,this._references=null,this._recordReference=null,this.__relationships=null,this.__implicitRelationships=null,this._bfsId=0}return e.prototype.isEmpty=function(){return this.currentState.isEmpty},e.prototype.isLoading=function(){return this.currentState.isLoading},e.prototype.isLoaded=function(){return this.currentState.isLoaded},e.prototype.hasDirtyAttributes=function(){return this.currentState.hasDirtyAttributes},e.prototype.isSaving=function(){return this.currentState.isSaving},e.prototype.isDeleted=function(){return this.currentState.isDeleted},e.prototype.isNew=function(){return this.currentState.isNew},e.prototype.isValid=function(){return this.currentState.isValid},e.prototype.dirtyType=function(){return this.currentState.dirtyType},e.prototype.getRecord=function(){if(!this._record&&!this._isDematerializing){var e={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};A?A(e,(0,l.getOwner)(this.store)):e.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).create(e),this._triggerDeferredTriggers()}return this._record},e.prototype.resetRecord=function(){this._record=null,this.dataHasInitialized=!1,this.isReloading=!1,this.error=null,this.currentState=i.default.empty,this.__attributes=null,this.__inFlightAttributes=null,this._data=null},e.prototype.dematerializeRecord=function(){this.record&&(this._isDematerializing=!0,this.record.destroy(),this.destroyRelationships(),this.updateRecordArrays(),this.resetRecord())},e.prototype.deleteRecord=function(){this.send("deleteRecord")},e.prototype.save=function(e){var t="DS: Model#save "+this,r=M.defer(t);return this.store.scheduleSave(this,r,e),r.promise},e.prototype.startedReloading=function(){this.isReloading=!0,this.hasRecord&&y(this.record,"isReloading",!0)},e.prototype.finishedReloading=function(){this.isReloading=!1,this.hasRecord&&y(this.record,"isReloading",!1)},e.prototype.reload=function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new F(function(t){e.send("reloadRecord",t)},t).then(function(){return e.didCleanError(),e},function(t){throw e.didError(t),t},"DS: Model#reload complete, update flags").finally(function(){e.finishedReloading(),e.updateRecordArrays()})},e.prototype._directlyRelatedInternalModels=function(){var e=this,t=[];return this.type.eachRelationship(function(r,i){if(e._relationships.has(r)){var a=e._relationships.get(r),n=a.members.toArray(),o=a.canonicalMembers.toArray();t=t.concat(n,o)}}),t},e.prototype._allRelatedInternalModels=function(){var e=[],t=[],r=E++;for(t.push(this),this._bfsId=r;t.length>0;){var i=t.shift();e.push(i);for(var a=i._directlyRelatedInternalModels(),n=0;n<a.length;++n){var o=a[n];o._bfsId<r&&(t.push(o),o._bfsId=r)}}return e},e.prototype.unloadRecord=function(){this.send("unloadRecord"),this.dematerializeRecord(),t.default.run.schedule("destroy",this,"_checkForOrphanedInternalModels")},e.prototype._checkForOrphanedInternalModels=function(){this._isDematerializing=!1,this.isDestroyed||this._cleanupOrphanedInternalModels()},e.prototype._cleanupOrphanedInternalModels=function(){var e=this._allRelatedInternalModels();if(p(e))for(var t=0;t<e.length;++t){var r=e[t];r.isDestroyed||r.destroy()}},e.prototype.eachRelationship=function(e,t){return this.modelClass.eachRelationship(e,t)},e.prototype.destroy=function(){this.store._removeFromIdMap(this),this._isDestroyed=!0},e.prototype.eachAttribute=function(e,t){return this.modelClass.eachAttribute(e,t)},e.prototype.inverseFor=function(e){return this.modelClass.inverseFor(e)},e.prototype.setupData=function(e){var t=void 0;this.hasRecord&&(t=this._changedKeys(e.attributes)),z(this._data,e.attributes),this.pushedData(),this.hasRecord&&this.record._notifyProperties(t),this.didInitializeData()},e.prototype.becameReady=function(){this.store.recordArrayManager.recordWasLoaded(this)},e.prototype.didInitializeData=function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},e.prototype.createSnapshot=function(e){return new n.default(this,e)},e.prototype.loadingData=function(e){this.send("loadingData",e)},e.prototype.loadedData=function(){this.send("loadedData"),this.didInitializeData()},e.prototype.notFound=function(){this.send("notFound")},e.prototype.pushedData=function(){this.send("pushedData")},e.prototype.flushChangedAttributes=function(){this._inFlightAttributes=this._attributes,this._attributes=new o.default},e.prototype.hasChangedAttributes=function(){return Object.keys(this._attributes).length>0},e.prototype.updateChangedAttributes=function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,a=t.length;i<a;i++){var n=t[i],o=e[n];o[0]===o[1]&&delete r[n]}},e.prototype.changedAttributes=function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=z(v(r),t),a=new o.default,n=Object.keys(i),s=0,d=n.length;s<d;s++){var l=n[s];a[l]=[e[l],i[l]]}return a},e.prototype.adapterWillCommit=function(){this.send("willCommit")},e.prototype.adapterDidDirty=function(){this.send("becomeDirty"),this.updateRecordArrays()},e.prototype.send=function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},e.prototype.notifyHasManyAdded=function(e,t,r){this.hasRecord&&this.record.notifyHasManyAdded(e,t,r)},e.prototype.notifyHasManyRemoved=function(e,t,r){this.hasRecord&&this.record.notifyHasManyRemoved(e,t,r)},e.prototype.notifyBelongsToChanged=function(e,t){this.hasRecord&&this.record.notifyBelongsToChanged(e,t)},e.prototype.notifyPropertyChange=function(e){this.hasRecord&&this.record.notifyPropertyChange(e)},e.prototype.rollbackAttributes=function(){var e=Object.keys(this._attributes);this._attributes=new o.default,m(this,"isError")&&(this._inFlightAttributes=new o.default,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o.default),this.send("rolledBack"),this.record._notifyProperties(e)},e.prototype.transitionTo=function(e){var t=h(e),r=this.currentState,i=r.stateName+"->"+e;do{r.exit&&r.exit(this),r=r.parentState}while(!r[t]);var a=void 0,n=void 0,o=void 0,s=void 0,d=T[i];if(d)a=d.setups,n=d.enters,r=d.state;else{a=[],n=[];var l=c(e);for(o=0,s=l.length;o<s;o++)r=r[l[o]],r.enter&&n.push(r),r.setup&&a.push(r);T[i]={setups:a,enters:n,state:r}}for(o=0,s=n.length;o<s;o++)n[o].enter(this);for(this.currentState=r,this.hasRecord&&y(this.record,"currentState",r),o=0,s=a.length;o<s;o++)a[o].setup(this);this.updateRecordArrays()},e.prototype._unhandledEvent=function(e,t,r){var i="Attempted to handle event `"+t+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==r&&(i+="Called with "+_(r)+"."),new b(i)},e.prototype.triggerLater=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&this.store._updateInternalModel(this)},e.prototype._triggerDeferredTriggers=function(){if(this.hasRecord){for(var e=0,t=this._deferredTriggers.length;e<t;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}},e.prototype.clearRelationships=function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var i=e._relationships.get(t);i.clear(),i.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})},e.prototype.destroyRelationships=function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){e._relationships.get(t).destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].destroy()})},e.prototype.preloadData=function(e){var t=this;Object.keys(e).forEach(function(r){var i=m(e,r);t.modelClass.metaForProperty(r).isRelationship?t._preloadRelationship(r,i):t._data[r]=i})},e.prototype._preloadRelationship=function(e,t){var r=this.modelClass.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)},e.prototype._preloadHasMany=function(e,t,r){for(var i=new Array(t.length),a=0;a<t.length;a++){var n=t[a];i[a]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(i)},e.prototype._preloadBelongsTo=function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(i)},e.prototype._convertStringOrNumberIntoInternalModel=function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},e.prototype.updateRecordArrays=function(){this._isUpdatingRecordArrays||(this._isUpdatingRecordArrays=!0,this.store.recordArrayManager.recordDidChange(this))},e.prototype.setId=function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)},e.prototype.didError=function(e){this.error=e,this.isError=!0,this.hasRecord&&this.record.setProperties({isError:!0,adapterError:e})},e.prototype.didCleanError=function(){this.error=null,this.isError=!1,this.hasRecord&&this.record.setProperties({isError:!1,adapterError:null})},e.prototype.adapterDidCommit=function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);z(this._data,this._inFlightAttributes),e&&z(this._data,e),this._inFlightAttributes=new o.default,this.send("didCommit"),this.updateRecordArrays(),e&&this.record._notifyProperties(t)},
|
2
|
-
e.prototype.addErrorMessageToAttribute=function(e,t){m(this.getRecord(),"errors")._add(e,t)},e.prototype.removeErrorMessageFromAttribute=function(e){m(this.getRecord(),"errors")._remove(e)},e.prototype.clearErrorMessages=function(){m(this.getRecord(),"errors")._clear()},e.prototype.hasErrors=function(){return!g(m(this.getRecord(),"errors"))},e.prototype.adapterDidInvalidate=function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},e.prototype.adapterDidError=function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},e.prototype._saveWasRejected=function(){for(var e=Object.keys(this._inFlightAttributes),t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=new o.default},e.prototype._changedKeys=function(e){var t=[];if(e){var r=void 0,i=void 0,a=void 0,n=void 0,s=Object.keys(e),d=s.length,l=this._attributes;for(r=z(new o.default,this._data),r=z(r,this._inFlightAttributes),i=0;i<d;i++)n=s[i],a=e[n],void 0===l[n]&&(R(r[n],a)||t.push(n))}return t},e.prototype.toString=function(){return"<"+this.modelName+":"+this.id+">"},e.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new u.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new u.HasManyReference(this.store,this,i)),this.references[t]=r}return r},f(e,[{key:"modelClass",get:function(){return this._modelClass||(this._modelClass=this.store._modelFor(this.modelName))}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new u.RecordReference(this.store,this)),this._recordReference}},{key:"_recordArrays",get:function(){return null===this.__recordArrays&&(this.__recordArrays=d.default.create()),this.__recordArrays}},{key:"references",get:function(){return null===this._references&&(this._references=new o.default),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=new o.default),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new a.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=new o.default),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_data",get:function(){return null===this.__data&&(this.__data=new o.default),this.__data},set:function(e){this.__data=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=new o.default),this.__implicitRelationships}},{key:"record",get:function(){return this._record}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=P,(0,s.default)("ds-rollback-attribute")&&(P.prototype.lastAcknowledgedValue=function(e){return e in this._inFlightAttributes?this._inFlightAttributes[e]:this._data[e]})}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/empty-object","ember-data/-private/system/relationships/ext"],function(e,t,r,i,a,n,o,s,d){function l(e,t,r,i){var a=i||[],n=u(t,"relationships");if(!n)return a;var o=n.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return o&&a.push.apply(a,o),e.superclass&&l(e.superclass,t,r,a),a}e.__esModule=!0;var u=t.default.get,c=t.default.computed,h=t.default.Map,p=c("currentState",function(e){return u(this._internalModel.currentState,e)}).readOnly(),f=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:p,isLoading:p,isLoaded:p,hasDirtyAttributes:c("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:p,isDeleted:p,isNew:p,isValid:p,dirtyType:p,isError:!1,isReloading:!1,id:null,currentState:o.default.empty,errors:c(function(){var e=a.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this._internalModel.createSnapshot().serialize(e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:function(){},didLoad:function(){},didUpdate:function(){},didCreate:function(){},didDelete:function(){},becameInvalid:function(){},becameError:function(){},rolledBack:function(){},send:function(e,t){return this._internalModel.send(e,t)},transitionTo:function(e){return this._internalModel.transitionTo(e)},deleteRecord:function(){this._internalModel.deleteRecord()},destroyRecord:function(e){return this.deleteRecord(),this.save(e)},unloadRecord:function(){this.isDestroyed||this._internalModel.unloadRecord()},_notifyProperties:function(e){t.default.beginPropertyChanges();for(var r=void 0,i=0,a=e.length;i<a;i++)r=e[i],this.notifyPropertyChange(r);t.default.endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return u(this,"id")},save:function(e){var t=this;return i.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return i.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];t.default.tryInvoke(this,e,i),this._super.apply(this,arguments)},willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)},setId:t.default.observer("id",function(){this._internalModel.setId(this.get("id"))}),_debugInfo:function(){var e=["id"],t={},r=[];this.eachAttribute(function(t,r){return e.push(t)});var i=[{name:"Attributes",properties:e,expand:!0}];return this.eachRelationship(function(e,a){var n=t[a.kind];void 0===n&&(n=t[a.kind]=[],i.push({name:a.name,properties:n,expand:!0})),n.push(e),r.push(e)}),i.push({name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}),{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}},notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)},didDefineProperty:function(e,r,i){if(i instanceof t.default.ComputedProperty){i.meta().parentType=e.constructor}},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return u(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)},notifyHasManyAdded:function(e){this.notifyPropertyChange(e)},eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});Object.defineProperty(f.prototype,"data",{get:function(){return this._internalModel._data}}),f.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=u(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return new s.default}),inverseFor:function(e,t){var r=u(this,"inverseMap");if(r[e])return r[e];var i=this._findInverseFor(e,t);return r[e]=i,i},_findInverseFor:function(e,r){var i=this.typeForRelationship(e,r);if(!i)return null;var a=this.metaForProperty(e),n=a.options;if(null===n.inverse)return null;var o=void 0,s=void 0,d=void 0;if(n.inverse)o=n.inverse,d=t.default.get(i,"relationshipsByName").get(o),s=d.kind;else{a.type,a.parentType.modelName;var u=l(this,i,e);if(0===u.length)return null;var c=u.filter(function(t){return e===i.metaForProperty(t.name).options.inverse});1===c.length&&(u=c),o=u[0].name,s=u[0].kind}return{type:i,name:o,kind:s}},relationships:d.relationshipsDescriptor,relationshipNames:t.default.computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:d.relatedTypesDescriptor,relationshipsByName:d.relationshipsByNameDescriptor,fields:t.default.computed(function(){var e=h.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){u(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=u(this,"relatedTypes"),i=0;i<r.length;i++){var a=r[i];e.call(t,a)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,a=this.inverseFor(r,t),n=void 0;return a?(n=a.kind,"belongsTo"===n?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"},attributes:t.default.computed(function(){var e=h.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t.default.computed(function(){var e=h.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){u(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){u(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),t.default.setOwner&&Object.defineProperty(f.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),(0,n.default)("ds-rollback-attribute")&&f.reopen({rollbackAttribute:function(e){e in this._internalModel._attributes&&this.set(e,this._internalModel.lastAcknowledgedValue(e))}}),e.default=f}),t("ember-data/-private/system/model/states",["exports","ember-data/-private/debug"],function(e,t){function r(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArrays()}function i(e){var t={},r=void 0;for(var a in e)r=e[a],t[a]=r&&"object"==typeof r?i(r):r;return t}function a(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return a(i(l),e)}function o(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function s(e){}function d(e,t,r){e=a(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var i in e)e.hasOwnProperty(i)&&"parentState"!==i&&"stateName"!==i&&"object"==typeof e[i]&&(e[i]=d(e[i],e,r+"."+i));return e}e.__esModule=!0;var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:r,loadingData:function(){},propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:function(){},willCommit:function(e){e.transitionTo("inFlight")},reloadRecord:function(e,t){t(e.store._reloadRecord(e))},rolledBack:function(e){e.transitionTo("loaded.saved")},becameInvalid:function(e){e.transitionTo("invalid")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")}},inFlight:{isSaving:!0,didSetProperty:r,becomeDirty:function(){},pushedData:function(){},unloadRecord:s,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",this.dirtyType)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),r(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},pushedData:function(){},willCommit:function(e){e.clearErrorMessages(),e.transitionTo("inFlight")},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")},invokeLifecycleCallbacks:function(e){e.triggerLater("becameInvalid",e)}}},u=n({dirtyType:"created",isNew:!0});u.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},u.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var c=n({dirtyType:"updated"});u.uncommitted.deleteRecord=o,u.invalid.deleteRecord=o,u.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},u.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},u.uncommitted.propertyWasReset=function(){},c.inFlight.unloadRecord=s,c.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var h={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){},propertyWasReset:function(){},empty:{isEmpty:!0,loadingData:function(e,t){e._loadingPromise=t,e.transitionTo("loading")},loadedData:function(e){e.transitionTo("loaded.created.uncommitted"),e.triggerLater("ready")},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready")}},loading:{isLoading:!0,exit:function(e){e._loadingPromise=null},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready"),e.didCleanError()},becameError:function(e){e.triggerLater("becameError",e)},notFound:function(e){e.transitionTo("empty")}},loaded:{initialState:"saved",isLoaded:!0,loadingData:function(){},saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:r,pushedData:function(){},becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store._reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){},didCommit:function(){},notFound:function(){}},created:u,updated:c},deleted:{initialState:"uncommitted",dirtyType:"deleted",isDeleted:!0,isLoaded:!0,isDirty:!0,setup:function(e){e.updateRecordArrays()},uncommitted:{willCommit:function(e){e.transitionTo("inFlight")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")},pushedData:function(){},becomeDirty:function(){},deleteRecord:function(){},rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:s,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships()},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),r(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},deleteRecord:function(){},willCommit:function(){},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")}}},invokeLifecycleCallbacks:function(e,t){"created"===t?e.triggerLater("didCreate",e):e.triggerLater("didUpdate",e),e.triggerLater("didCommit",e)}};e.default=d(h,null,"root")}),t("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t.default.String.dasherize(e)}e.__esModule=!0,e.default=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.__esModule=!0,e.default=r;var i=t.default.OrderedSet,a=t.default.guidFor;r.create=function(){return new this},r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype._super$constructor=i,r.prototype.addWithIndex=function(e,t){var r=a(e),i=this.presenceSet,n=this.list;if(i[r]!==!0)return i[r]=!0,void 0===t||null===t?n.push(e):n.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t){return u.create({promise:d.resolve(e,t)})}function a(e,t){return l.create({promise:d.resolve(e,t)})}function n(e){return function(){var t;return(t=s(this,"content"))[e].apply(t,arguments)}}function o(e,t){return c.create({promise:d.resolve(e,t)})}e.__esModule=!0,e.PromiseManyArray=e.PromiseObject=e.PromiseArray=void 0,e.promiseObject=i,e.promiseArray=a,e.proxyToContent=n,e.promiseManyArray=o;var s=t.default.get,d=t.default.RSVP.Promise,l=e.PromiseArray=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin),u=e.PromiseObject=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin),c=e.PromiseManyArray=l.extend({reload:function(){return this.set("promise",this.get("content").reload()),this},createRecord:n("createRecord"),on:n("on"),one:n("one"),trigger:n("trigger"),off:n("off"),has:n("has")})}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/debug"],function(e,t,r,i){function a(e){e.destroy()}function n(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function o(e,t){var r=e.indexOf(t);return r!==-1&&(e.splice(r,1),!0)}e.__esModule=!0;var s=t.default.get,d=t.default.MapWithDefault,l=t.default.run,u=function(){function e(e){var t=this;this.store=e.store,this.isDestroying=!1,this.isDestroyed=!1,this.filteredRecordArrays=d.create({defaultValue:function(){return[]}}),this.liveRecordArrays=d.create({defaultValue:function(e){return t.createRecordArray(e)}}),this.changedRecords=[],this.loadedRecords=[],this._adapterPopulatedRecordArrays=[]}return e.prototype.recordDidChange=function(e){1===this.changedRecords.push(e)&&l.schedule("actions",this,this.updateRecordArrays)},e.prototype.recordArraysForRecord=function(e){return e._recordArrays},e.prototype.updateRecordArrays=function(){for(var e=this.changedRecords,t=0,r=e.length;t<r;t++){var i=e[t];i._isDematerializing||i.isDestroyed||"root.deleted.saved"===i.currentState.stateName?this._recordWasDeleted(i):this._recordWasChanged(i),i._isUpdatingRecordArrays=!1}e.length=0},e.prototype._recordWasDeleted=function(e){var t=e.__recordArrays;t&&(t.forEach(function(t){return t._removeInternalModels([e])}),e.__recordArrays=null)},e.prototype._recordWasChanged=function(e){var t=this,r=e.modelName,i=this.filteredRecordArrays.get(r),a=void 0;i.forEach(function(i){a=s(i,"filterFunction"),t.updateFilterRecordArray(i,a,r,e)})},e.prototype.recordWasLoaded=function(e){1===this.loadedRecords.push(e)&&l.schedule("actions",this,this._flushLoadedRecords)},e.prototype._flushLoadedRecords=function(){for(var e=this.loadedRecords,t=0,r=e.length;t<r;t++){for(var i=e[t],a=i.modelName,n=this.filteredRecordArrays.get(a),o=void 0,d=0,l=n.length;d<l;d++){var u=n[d];o=s(u,"filterFunction"),this.updateFilterRecordArray(u,o,a,i)}if(this.liveRecordArrays.has(a)){var c=this.liveRecordArrays.get(a);this._addInternalModelToRecordArray(c,i)}}this.loadedRecords.length=0},e.prototype.updateFilterRecordArray=function(e,t,r,i){var a=t(i.getRecord()),n=this.recordArraysForRecord(i);a?this._addInternalModelToRecordArray(e,i):(n.delete(e),e._removeInternalModels([i]))},e.prototype._addInternalModelToRecordArray=function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e._pushInternalModels([t]),r.add(e))},e.prototype.syncLiveRecordArray=function(e,t){var r=0===this.changedRecords.length,i=this.store._internalModelsFor(t),a=i.length===e.length;r&&a||this.populateLiveRecordArray(e,t)},e.prototype.populateLiveRecordArray=function(e,t){for(var r=this.store._internalModelsFor(t),i=r.models,a=0;a<i.length;a++){var n=i[a];n.isDeleted()||n.isEmpty()||this._addInternalModelToRecordArray(e,n)}},e.prototype.updateFilter=function(e,t,r){for(var i=this.store._internalModelsFor(t),a=i.models,n=0;n<a.length;n++){var o=a[n];o.isDeleted()||o.isEmpty()||this.updateFilterRecordArray(e,r,t,o)}},e.prototype.liveRecordArrayFor=function(e){return this.liveRecordArrays.get(e)},e.prototype.createRecordArray=function(e){return r.RecordArray.create({modelName:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this})},e.prototype.createFilteredRecordArray=function(e,i,a){var n=r.FilteredRecordArray.create({query:a,modelName:e,content:t.default.A(),store:this.store,manager:this,filterFunction:i});return this.registerFilteredRecordArray(n,e,i),n},e.prototype.createAdapterPopulatedRecordArray=function(e,i){var a=r.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(a),a},e.prototype.registerFilteredRecordArray=function(e,t,r){this.filteredRecordArrays.get(t).push(e),this.updateFilter(e,t,r)},e.prototype.unregisterRecordArray=function(e){var t=e.modelName,r=this.filteredRecordArrays.get(t),i=o(r,e),a=o(this._adapterPopulatedRecordArrays,e);if(!i&&!a&&this.liveRecordArrays.has(t)){e===this.liveRecordArrayFor(t)&&this.liveRecordArrays.delete(t)}},e.prototype.willDestroy=function(){this.filteredRecordArrays.forEach(function(e){return n(e).forEach(a)}),this.liveRecordArrays.forEach(a),this._adapterPopulatedRecordArrays.forEach(a),this.isDestroyed=!0},e.prototype.destroy=function(){this.isDestroying=!0,t.default.run.schedule("actions",this,this.willDestroy)},e}();e.default=u}),t("ember-data/-private/system/record-arrays",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/record-arrays/filtered-record-array","ember-data/-private/system/record-arrays/adapter-populated-record-array"],function(e,t,r,i){e.__esModule=!0,e.AdapterPopulatedRecordArray=e.FilteredRecordArray=e.RecordArray=void 0,e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=i.default}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null"],function(e,t,r,i){e.__esModule=!0;var a=t.default.get;e.default=r.default.extend({init:function(){this.set("content",this.get("content")||t.default.A()),this._super.apply(this,arguments),this.query=this.query||null,this.links=null},replace:function(){throw new Error("The result of a server query (on "+this.modelName+") is immutable.")},_update:function(){var e=a(this,"store"),t=a(this,"query");return e._query(this.modelName,t,this)},_setInternalModels:function(e,r){this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,i.default)(r.meta),links:(0,i.default)(r.links)});for(var a=0,n=e.length;a<n;a++){var o=e[a];this.manager.recordArraysForRecord(o).add(this)}t.default.run.once(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){e.__esModule=!0;var i=t.default.get;e.default=r.default.extend({init:function(){this._super.apply(this,arguments),this.set("filterFunction",this.get("filterFunction")||null),this.isLoaded=!0},replace:function(){throw new Error("The result of a client-side filter (on "+this.modelName+") is immutable.")},_updateFilter:function(){i(this,"isDestroying")||i(this,"isDestroyed")||i(this,"manager").updateFilter(this,this.modelName,i(this,"filterFunction"))},updateFilter:t.default.observer("filterFunction",function(){t.default.run.once(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i){e.__esModule=!0;var a=t.default.computed,n=t.default.get,o=t.default.set,s=t.default.RSVP.Promise;e.default=t.default.ArrayProxy.extend(t.default.Evented,{init:function(){this._super.apply(this,arguments),this.set("content",this.content||null),this.isLoaded=this.isLoaded||!1,this.isUpdating=!1,this.store=this.store||null,this._updatingPromise=null},replace:function(){throw new Error("The result of a server query (for all "+this.modelName+" types) is immutable. To modify contents, use toArray()")},type:a("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=n(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(n(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){n(this,"content").pushObjects(e)},_removeInternalModels:function(e){n(this,"content").removeObjects(e)},save:function(){var e=this,t="DS: RecordArray#save "+this.modelName,i=s.all(this.invoke("save"),t).then(function(){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:i})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t.__recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){this.manager.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),o(this,"content",null),o(this,"length",0),this._super.apply(this,arguments)},_createSnapshot:function(e){return new i.default(this,this.get("meta"),e)},_takeSnapshot:function(){return n(this,"content").map(function(e){return e.createSnapshot()})}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,i){e.__esModule=!0,e.HasManyReference=e.BelongsToReference=e.RecordReference=void 0,e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a,n){e.__esModule=!0;var o=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(i.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=i.default,o.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},o.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},o.prototype.link=function(){return this.belongsToRelationship.link},o.prototype.meta=function(){return this.belongsToRelationship.meta},o.prototype.push=function(e){var i=this;return r.default.RSVP.resolve(e).then(function(e){var r=void 0;return e instanceof t.default?((0,a.default)("ds-overhaul-references"),r=e):r=i.store.push(e),i.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},o.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.isLoaded()?e.getRecord():null},o.prototype.load=function(){var e=this;return"id"===this.remoteType()?this.belongsToRelationship.getRecord():"link"===this.remoteType()?this.belongsToRelationship.findLink().then(function(t){return e.value()}):void 0},o.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=o}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i,a){e.__esModule=!0;var n=t.default.RSVP.resolve,o=t.default.get,s=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};s.prototype=Object.create(r.default.prototype),s.prototype.constructor=s,s.prototype._super$constructor=r.default,s.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},s.prototype.link=function(){return this.hasManyRelationship.link},s.prototype.ids=function(){return this.hasManyRelationship.members.toArray().map(function(e){return e.id})},s.prototype.meta=function(){return this.hasManyRelationship.meta},s.prototype.push=function(e){var r=this;return n(e).then(function(e){var i=e;(0,a.default)("ds-overhaul-references");var n=!0;"object"==typeof e&&e.data&&(i=e.data,n=i.length&&i[0].data,(0,a.default)("ds-overhaul-references")),(0,a.default)("ds-overhaul-references")||(n=!0);var o=void 0;if(n)o=i.map(function(e){return r.store.push(e)._internalModel});else{var s=r.store.push(e);o=t.default.A(s).mapBy("_internalModel")}return r.hasManyRelationship.computeChanges(o),r.hasManyRelationship.manyArray})},s.prototype._isLoaded=function(){return!!o(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().every(function(e){return e.isLoaded()===!0})},s.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},s.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.manyArray):this.hasManyRelationship.getRecords()},s.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=s}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){e.__esModule=!0;var i=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};i.prototype=Object.create(r.default.prototype),i.prototype.constructor=i,i.prototype._super$constructor=r.default,i.prototype.id=function(){return this._id},i.prototype.remoteType=function(){return"identity"},i.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){return r.store.push(e)})},i.prototype.value=function(){return this.internalModel.record},i.prototype.load=function(){return this.store.findRecord(this.type,this._id)},i.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=i}),t("ember-data/-private/system/references/reference",["exports"],function(e){e.__esModule=!0;var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e.default=t}),t("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function i(e){var i=void 0;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function a(e){return{key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0}}e.__esModule=!0,e.typeForRelationshipMeta=i,e.relationshipFromMeta=a}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,i){function a(e,r){var a=void 0,n=void 0;"object"==typeof e?(a=e,n=void 0):(a=r,n=e),
|
3
|
-
"string"==typeof n&&(n=(0,i.default)(n)),a=a||{};var o={type:n,isRelationship:!0,options:a,kind:"belongsTo",name:"Belongs To",key:null};return t.default.computed({get:function(e){return a.hasOwnProperty("serialize"),a.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.__esModule=!0,e.default=a}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta"],function(e,t,r,i){e.__esModule=!0,e.relationshipsByNameDescriptor=e.relatedTypesDescriptor=e.relationshipsDescriptor=void 0;var a=t.default.Map,n=t.default.MapWithDefault,o=e.relationshipsDescriptor=t.default.computed(function(){t.default.testing===!0&&o._cacheable===!0&&(o._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;e.get((0,i.typeForRelationshipMeta)(r)).push({name:t,kind:r.kind})}}),e}).readOnly(),s=e.relatedTypesDescriptor=t.default.computed(function(){t.default.testing===!0&&s._cacheable===!0&&(s._cacheable=!1);var e=void 0,r=t.default.A();return this.eachComputedProperty(function(t,a){a.isRelationship&&(a.key=t,e=(0,i.typeForRelationshipMeta)(a),r.includes(e)||r.push(e))}),r}).readOnly(),d=e.relationshipsByNameDescriptor=t.default.computed(function(){t.default.testing===!0&&d._cacheable===!0&&(d._cacheable=!1);var e=a.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var a=(0,i.relationshipFromMeta)(r);a.type=(0,i.typeForRelationshipMeta)(r),e.set(t,a)}}),e}).readOnly()}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,i,a){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,i.default)(e));var a={type:e,options:r,isRelationship:!0,kind:"hasMany",name:"Has Many",key:null};return t.default.computed({get:function(e){return this._internalModel._relationships.get(e).getRecords()},set:function(e,t){var r=this._internalModel._relationships.get(e);return r.clear(),r.addRecords(t.map(function(e){return o(e,"_internalModel")})),r.getRecords()}}).meta(a)}e.__esModule=!0,e.default=n;var o=t.default.get}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a){function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.__esModule=!0;var s=function(e){function r(t,r,i,a){var o=n(this,e.call(this,t,r,i,a));return o.internalModel=r,o.key=a.key,o.inverseRecord=null,o.canonicalState=null,o}return o(r,e),r.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},r.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.flushCanonicalLater()},r.prototype.addCanonicalRecord=function(t){this.canonicalMembers.has(t)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=t,e.prototype.addCanonicalRecord.call(this,t))},r.prototype.inverseDidDematerialize=function(){this.notifyBelongsToChanged()},r.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord!==this.canonicalState&&(this.inverseRecord=this.canonicalState,this.notifyBelongsToChanged()),e.prototype.flushCanonical.call(this))},r.prototype.addRecord=function(t){this.members.has(t)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=t,e.prototype.addRecord.call(this,t),this.notifyBelongsToChanged())},r.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},r.prototype.removeRecordFromOwn=function(t){this.members.has(t)&&(this.inverseRecord=null,e.prototype.removeRecordFromOwn.call(this,t),this.notifyBelongsToChanged())},r.prototype.notifyBelongsToChanged=function(){this.internalModel.notifyBelongsToChanged(this.key)},r.prototype.removeCanonicalRecordFromOwn=function(t){this.canonicalMembers.has(t)&&(this.canonicalState=null,e.prototype.removeCanonicalRecordFromOwn.call(this,t))},r.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t.default.RSVP.Promise.resolve(null)},r.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},r.prototype.getRecord=function(){var e=this;if(this.isAsync){var t=void 0;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),i.PromiseObject.create({promise:t,content:this.inverseRecord?this.inverseRecord.getRecord():null})}return null===this.inverseRecord?null:this.inverseRecord.getRecord()},r.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.hasRecord?this.inverseRecord.record.reload():this.findRecord()},r.prototype.updateData=function(e){var t=this.store._pushResourceIdentifier(this,e);this.setCanonicalRecord(t)},r}(a.default);e.default=s}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object","ember-data/-private/debug"],function(e,t,r,i,a,n){function o(e){var t=e.options;return!(t&&null===t.inverse)}function s(e,t,a){var n=void 0,s=null;return o(t)&&(s=e.type.inverseFor(t.key,a)),s&&(n=s.name),"hasMany"===t.kind?new r.default(a,e,n,t):new i.default(a,e,n,t)}e.__esModule=!0;var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),l=t.default.get,u=function(){function e(e){this.internalModel=e,this.initializedRelationships=new a.default}return e.prototype.has=function(e){return!!this.initializedRelationships[e]},e.prototype.get=function(e){var t=this.initializedRelationships,r=t[e];if(!r){var i=this.internalModel,a=l(i.type,"relationshipsByName"),n=a.get(e);n&&(r=t[e]=s(i,n,i.store))}return r},d(e,[{key:"record",get:function(){return this.internalModel}}]),e}();e.default=u}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,i,a,n){function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e){var t=new a.default;if(e)for(var r=0,i=e.length;r<i;r++)t.add(e[r]);return t}e.__esModule=!0;var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),u=function(e){function t(t,r,i,a){var n=o(this,e.call(this,t,r,i,a));return n.belongsToType=a.type,n.canonicalState=[],n.isPolymorphic=a.options.polymorphic,n._manyArray=null,n.__loadingPromise=null,n}return s(t,e),t.prototype._updateLoadingPromise=function(e,t){return this.__loadingPromise?(t&&this.__loadingPromise.set("content",t),this.__loadingPromise.set("promise",e)):this.__loadingPromise=new r.PromiseManyArray({promise:e,content:t}),this.__loadingPromise},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this._loadingPromise&&this._loadingPromise.destroy()},t.prototype.updateMeta=function(t){e.prototype.updateMeta.call(this,t),this._manyArray&&this._manyArray.set("meta",t)},t.prototype.addCanonicalRecord=function(t,r){this.canonicalMembers.has(t)||(void 0!==r?this.canonicalState.splice(r,0,t):this.canonicalState.push(t),e.prototype.addCanonicalRecord.call(this,t,r))},t.prototype.inverseDidDematerialize=function(){this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this.notifyHasManyChanged()},t.prototype.addRecord=function(t,r){this.members.has(t)||(e.prototype.addRecord.call(this,t,r),this.manyArray.internalAddRecords([t],r))},t.prototype.removeCanonicalRecordFromOwn=function(t,r){var i=r;this.canonicalMembers.has(t)&&(void 0===i&&(i=this.canonicalState.indexOf(t)),i>-1&&this.canonicalState.splice(i,1),e.prototype.removeCanonicalRecordFromOwn.call(this,t,r))},t.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),e.prototype.flushCanonical.call(this)},t.prototype.removeRecordFromOwn=function(t,r){if(this.members.has(t)){e.prototype.removeRecordFromOwn.call(this,t,r);var i=this.manyArray;void 0!==r?i.currentState.removeAt(r):i.internalRemoveRecords([t])}},t.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},t.prototype.reload=function(){var e=this.manyArray,t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}var r=void 0;return r=this.link?this.fetchLink():this.store._scheduleFetchMany(e.currentState).then(function(){return e}),this._updateLoadingPromise(r),this._loadingPromise},t.prototype.computeChanges=function(e){var t=this.canonicalMembers,r=[],i=d(e);t.forEach(function(e){i.has(e)||r.push(e)}),this.removeCanonicalRecords(r);for(var a=0,n=e.length;a<n;a++){var o=e[a];this.removeCanonicalRecord(o),this.addCanonicalRecord(o,a)}},t.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},t.prototype.findRecords=function(){var e=this.manyArray,t=e.currentState;return this.store.findMany(t).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},t.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},t.prototype.getRecords=function(){var e=this,t=this.manyArray;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._updateLoadingPromise(r,t)}return t.get("isDestroyed")||t.set("isLoaded",!0),t},t.prototype.updateData=function(e){var t=this.store._pushResourceIdentifiers(this,e);this.updateRecordsFromAdapter(t)},l(t,[{key:"_loadingPromise",get:function(){return this.__loadingPromise}},{key:"manyArray",get:function(){return this._manyArray||(this._manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:this.record,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray}}]),t}(i.default);e.default=u}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/debug","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r,i){e.__esModule=!0;var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),n=function(){function e(e,t,i,a){var n=a.options.async;this.members=new r.default,this.canonicalMembers=new r.default,this.store=e,this.key=a.key,this.inverseKey=i,this.internalModel=t,this.isAsync=void 0===n||n,this.relationshipMeta=a,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}return e.prototype.destroy=function(){var e=this;if(this.inverseKey){this.members.toArray().concat(this.canonicalMembers.toArray()).forEach(function(t){var r=t._relationships.get(e.inverseKey);r&&r.inverseDidDematerialize()})}},e.prototype.inverseDidDematerialize=function(){},e.prototype.updateMeta=function(e){this.meta=e},e.prototype.clear=function(){for(var e=this.members.list;e.length>0;){var t=e[0];this.removeRecord(t)}for(var r=this.canonicalMembers.list;r.length>0;){var i=r[0];this.removeCanonicalRecord(i)}},e.prototype.removeRecords=function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},e.prototype.addRecords=function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},e.prototype.addCanonicalRecords=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},e.prototype.addCanonicalRecord=function(t,r){this.canonicalMembers.has(t)||(this.canonicalMembers.add(t),this.inverseKey?t._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},e.prototype.removeCanonicalRecords=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},e.prototype.removeCanonicalRecord=function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},e.prototype.addRecord=function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addRecord(this.record):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArrays()),this.setHasData(!0)},e.prototype.removeRecord=function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},e.prototype.removeRecordFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},e.prototype.removeRecordFromOwn=function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},e.prototype.removeCanonicalRecordFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},e.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},e.prototype.flushCanonical=function(){var e=this.members.list;this.willSync=!1;for(var t=[],r=0;r<e.length;r++)e[r].isNew()&&t.push(e[r]);this.members=this.canonicalMembers.copy();for(var i=0;i<t.length;i++)this.members.add(t[i])},e.prototype.flushCanonicalLater=function(){this.willSync||(this.willSync=!0,this.store._updateRelationshipState(this))},e.prototype.updateLink=function(e){this.link=e,this.linkPromise=null,this.record.notifyPropertyChange(this.key)},e.prototype.findLink=function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},e.prototype.updateRecordsFromAdapter=function(e){this.computeChanges(e)},e.prototype.notifyRecordRelationshipAdded=function(){},e.prototype.notifyRecordRelationshipRemoved=function(){},e.prototype.setHasData=function(e){this.hasData=e},e.prototype.setHasLoaded=function(e){this.hasLoaded=e},e.prototype.push=function(e){var t=!1,r=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(t=!0,this.updateData(e.data)),e.links&&e.links.related){var a=(0,i.default)(e.links.related);a&&a.href&&a.href!==this.link&&(r=!0,this.updateLink(a.href))}t?(this.setHasData(!0),this.setHasLoaded(!0)):r&&this.setHasLoaded(!1)},e.prototype.updateData=function(){},a(e,[{key:"record",get:function(){return this.internalModel}},{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=n}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){function t(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e.__esModule=!0,e.default=t,t.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){e.__esModule=!0;var i=t.default.get,a=function(){function e(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._attributes=new r.default,this._belongsToRelationships=new r.default,this._belongsToIds=new r.default,this._hasManyRelationships=new r.default,this._hasManyIds=new r.default,this._internalModel=e;var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=i(n,e)}),this.id=e.id,this.adapterOptions=a.adapterOptions,this.include=a.include,this.type=e.modelClass,this.modelName=e.modelName,this._changedAttributes=n.changedAttributes()}return e.prototype.attr=function(e){if(e in this._attributes)return this._attributes[e];throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no attribute named '"+e+"' defined.")},e.prototype.attributes=function(){return t.default.copy(this._attributes)},e.prototype.changedAttributes=function e(){for(var e=new r.default,i=Object.keys(this._changedAttributes),a=0,n=i.length;a<n;a++){var o=i[a];e[o]=t.default.copy(this._changedAttributes[o])}return e},e.prototype.belongsTo=function(e,r){var a=r&&r.id,n=void 0,o=void 0,s=void 0,d=void 0;if(a&&e in this._belongsToIds)return this._belongsToIds[e];if(!a&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(n=this._internalModel._relationships.get(e))||"belongsTo"!==n.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return s=i(n,"hasData"),o=i(n,"inverseRecord"),s&&(d=o&&!o.isDeleted()?a?i(o,"id"):o.createSnapshot():null),a?this._belongsToIds[e]=d:this._belongsToRelationships[e]=d,d},e.prototype.hasMany=function(e,r){var a=r&&r.ids,n=void 0,o=void 0,s=void 0,d=void 0;if(a&&e in this._hasManyIds)return this._hasManyIds[e];if(!a&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(n=this._internalModel._relationships.get(e))||"hasMany"!==n.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return s=i(n,"hasData"),o=i(n,"members"),s&&(d=[],o.forEach(function(e){e.isDeleted()||(a?d.push(e.id):d.push(e.createSnapshot()))})),a?this._hasManyIds[e]=d:this._hasManyRelationships[e]=d,d},e.prototype.eachAttribute=function(e,t){this.record.eachAttribute(e,t)},e.prototype.eachRelationship=function(e,t){this.record.eachRelationship(e,t)},e.prototype.serialize=function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)},e}();e.default=a}),t("ember-data/-private/system/store",["exports","ember","ember-data/-private/debug","ember-data/model","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/identity-map","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,p,f,m,y,v,b){function _(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function g(e){return e.serializerFor("application")}function R(e,t,r,i){var a=i._internalModel,o=i.modelName,s=t._modelFor(o),c=e[r](t,s,i),h=(0,u.serializerForAdapter)(t,e,o),p="DS: Extract and notify about "+r+" completion of "+a;return c=j.resolve(c,p),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,t)),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,a)),c.then(function(e){return t._backburner.join(function(){var n=void 0,o=void 0;e&&(n=(0,l.normalizeResponseHelper)(h,t,s,e,i.id,r),n.included&&t._push({data:null,included:n.included}),o=n.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof n.InvalidError){var r=h.extractErrors(t,s,e,i.id);t.recordWasInvalid(a,r)}else t.recordWasError(a,e);throw e},p)}function A(e,t,r){r.relationships&&t.type.eachRelationship(function(e,i){if(r.relationships[e]){t._relationships.get(e).push(r.relationships[e])}})}e.__esModule=!0,e.Store=e.badIdFormatAssertion=void 0;var M=(e.badIdFormatAssertion="`id` passed to `findRecord()` has to be non-empty string or number",t.default.A),F=t.default._Backburner,z=t.default.computed,T=t.default.copy,k=t.default.ENV,S=t.default.Error,x=t.default.get,E=(t.default.inspect,t.default.isNone),P=(t.default.isPresent,t.default.MapWithDefault),w=t.default.run,N=t.default.set,C=t.default.RSVP,D=t.default.Service,j=(t.default.typeOf,C.Promise),I=void 0;e.Store=I=D.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=new f.default({store:this}),this._identityMap=new o.default,this._pendingSave=[],this._instanceCache=new m.default((0,h.getOwner)(this),this),this._modelFactoryCache=new v.default,this._pendingSave=[],this._updatedRelationships=[],this._pushedInternalModels=[],this._updatedInternalModels=[],this._pendingFetch=P.create({defaultValue:function(){return[]}}),this._instanceCache=new m.default((0,h.getOwner)(this),this)},adapter:"-json-api",serialize:function(e,t){return e._internalModel.createSnapshot().serialize(t)},defaultAdapter:z("adapter",function(){var e=x(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=(0,a.default)(e),i=T(t)||new v.default;E(i.id)&&(i.id=this._generateId(r,i)),i.id=(0,p.default)(i.id);var n=this.buildInternalModel(r,i.id),o=n.getRecord();return n.loadedData(),o.setProperties(i),n.eachRelationship(function(e,t){n._relationships.get(e).setHasData(!0)}),o},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,t,r){var i=(0,a.default)(e);return this.findRecord(i,t)},findRecord:function(e,t,r){var i=(0,a.default)(e),n=this._internalModelForId(i,t);return r=r||{},this.hasRecordForId(i,t)?_(this._findRecord(n,r),"DS: Store#findRecord "+i+" with id: "+t):this._findByInternalModel(n,r)},_findRecord:function(e,t){if(t.reload)return this._scheduleFetch(e,t);var r=e.createSnapshot(t),i=this.adapterFor(e.modelName);return i.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):t.backgroundReload===!1?j.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),j.resolve(e))},_findByInternalModel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.preload&&e.preloadData(t.preload),_(this._findEmptyInternalModel(e,t),"DS: Store#findRecord "+e.modelName+" with id: "+e.id)},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:j.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=(0,a.default)(e),n=0;n<t.length;n++)r[n]=this.findRecord(i,t[n]);return(0,s.promiseArray)(C.all(r).then(M,null,"DS: Store#findByIds of "+i+" complete"))},_fetchRecord:function(e,t){var r=e.modelName,i=this.adapterFor(r);return(0,c._find)(i,this,e.type,e.id,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return j.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.id,i=e.modelName,a=C.defer("Fetching "+i+"' with id: "+r),n={internalModel:e,resolver:a,options:t},o=a.promise;return e.loadingData(o),0===this._pendingFetch.size&&w.schedule("afterRender",this,this.flushAllPendingFetches),this._pendingFetch.get(i).push(n),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=n._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=new v.default,i=0,n=e.length;i<n;i++){var o=e[i],s=u[o.id];if(r[o.id]=o,s){s.resolver.resolve(o)}}for(var d=[],l=0,c=t.length;l<c;l++){var h=t[l];r[h.id]||d.push(h)}d.length&&a(d)}function a(e,t){for(var r=0,i=e.length;r<i;r++){var a=e[r],n=u[a.id];n&&n.resolver.reject(t||new Error("Expected: '"+a+"' to be present in the adapter provided payload, but it was not found."))}}for(var n=this,o=n.adapterFor(t),s=!!o.findMany&&o.coalesceFindRequests,d=e.length,l=new Array(d),u=new v.default,h=0;h<d;h++){var p=e[h],f=p.internalModel;l[h]=f,u[f.id]=p}if(s){for(var m=new Array(d),y=0;y<d;y++)m[y]=l[y].createSnapshot();for(var b=o.groupRecordsForFindMany(this,m),_=0,g=b.length;_<g;_++)!function(e,s){for(var d=b[s],l=b[s].length,h=new Array(l),p=new Array(l),f=0;f<l;f++){var m=d[f]._internalModel;p[f]=m,h[f]=m.id}if(l>1)(0,c._findMany)(o,n,t,h,p).then(function(e){i(e,p)}).catch(function(e){a(p,e)});else if(1===h.length){var y=u[p[0].id];r(y)}}(0,_)}else for(var R=0;R<d;R++)r(e[R])},getReference:function(e,t){var r=(0,a.default)(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=(0,a.default)(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,t).getRecord():null},_reloadRecord:function(e){var t=(e.id,e.modelName);this.adapterFor(t);return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,a.default)(e),i=(0,p.default)(t),n=this._internalModelsFor(r).get(i);return!!n&&n.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,p.default)(t),i=this._internalModelsFor(e).get(r);return i||(i=this.buildInternalModel(e,r)),i},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findEmptyInternalModel(e[r]);return j.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=(0,a.default)(e);return this._query(r,t)},_query:function(e,t,r){r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(e,t);var i=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(i,this,e,t,r))},queryRecord:function(e,t){var r=(0,a.default)(e),i=this.adapterFor(r);return(0,s.promiseObject)((0,c._queryRecord)(i,this,e,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=(0,a.default)(e);return this._fetchAll(r,this.peekAll(r),t)},_fetchAll:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.adapterFor(e),a=this._internalModelsFor(e).metadata.since;if(r.reload)return N(t,"isUpdating",!0),(0,s.promiseArray)((0,c._findAll)(i,this,e,a,r));var n=t._createSnapshot(r);return i.shouldReloadAll(this,n)?(N(t,"isUpdating",!0),(0,s.promiseArray)((0,c._findAll)(i,this,e,a,r))):r.backgroundReload===!1?(0,s.promiseArray)(j.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,n))&&(N(t,"isUpdating",!0),(0,c._findAll)(i,this,e,a,r)),(0,s.promiseArray)(j.resolve(t)))},didUpdateAll:function(e){N(this.recordArrayManager.liveRecordArrayFor(e),"isUpdating",!1)},peekAll:function(e){var t=(0,a.default)(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.syncLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length)this._identityMap.clear();else{var t=(0,a.default)(e);this._internalModelsFor(t).clear()}},filter:function(e,t,r){k.ENABLE_DS_FILTER;var i=void 0,n=arguments.length,o=void 0,d=3===n,l=(0,a.default)(e);return d?i=this.query(l,t):2===arguments.length&&(r=t),o=d?this.recordArrayManager.createFilteredRecordArray(l,r,t):this.recordArrayManager.createFilteredRecordArray(l,r),i=i||j.resolve(o),(0,s.promiseArray)(i.then(function(){return o},null,"DS: Store#filter of "+l))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),w.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this._pendingSave.slice();this._pendingSave=[];for(var t=0,r=e.length;t<r;t++){var i=e[t],a=i.snapshot,n=i.resolver,o=a._internalModel,s=this.adapterFor(o.modelName),d=void 0;if("root.deleted.saved"===o.currentState.stateName)return n.resolve();d=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",n.resolve(R(s,this,d,a))}},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this.updateId(e,r),this._setupRelationshipsForModel(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=e.id,i=(e.modelName,(0,p.default)(t.id));null!==r&&null===i||(this._internalModelsFor(e.modelName).set(i,e),e.setId(i))},_internalModelsFor:function(e){return this._identityMap.retrieve(e)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,h.getOwner)(this),r=void 0;if(t.factoryFor){var a=t.factoryFor("mixin:"+e);r=a&&a.class}else r=t._lookupFactory("mixin:"+e);if(r){var n=i.default.extend(r);n.reopenClass({
|
4
|
-
__isMixin:!0,__mixin:r}),t.register("model:"+e,n)}return this.modelFactoryFor(e)},modelFor:function(e){var t=(0,a.default)(e);return this._modelFor(t)},_modelFor:function(e){var t=this._modelFactoryFor(e);return t.class?t.class:t},_modelFactoryFor:function(e){var t=this._modelFactoryCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new S("No model was found for '"+e+"'");var r=(0,h.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelFactoryCache[e]=t}return t},modelFactoryFor:function(e){var t=(0,a.default)(e),r=(0,h.getOwner)(this);return r.factoryFor?r.factoryFor("model:"+t):r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){return t.map(function(e){return e.getRecord()})}return null===t?null:t.getRecord()},_push:function(e){var t=this;return this._backburner.join(function(){var r=e.included,i=void 0,a=void 0;if(r)for(i=0,a=r.length;i<a;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){a=e.data.length;var n=new Array(a);for(i=0;i<a;i++)n[i]=t._pushInternalModel(e.data[i]);return n}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,h.getOwner)(this);return e=(0,a.default)(e),t.factoryFor?!!t.factoryFor("model:"+e):!!t._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=(e.type,this._load(e));return this._setupRelationshipsForModel(t,e),t},_setupRelationshipsForModel:function(e,t){2===this._pushedInternalModels.push(e,t)&&this._backburner.schedule("normalizeRelationships",this,this._setupRelationships)},_setupRelationships:function(){for(var e=this._pushedInternalModels,t=0,r=e.length;t<r;t+=2){A(this,e[t],e[t+1])}e.length=0},pushPayload:function(e,t){var r=void 0,i=void 0;if(t){i=t;var n=(0,a.default)(e);r=this.serializerFor(n)}else i=e,r=g(this);if((0,b.default)("ds-pushpayload-return"))return r.pushPayload(this,i);r.pushPayload(this,i)},normalize:function(e,t){var r=(0,a.default)(e),i=this.serializerFor(r),n=this._modelFor(r);return i.normalize(n,t)},buildInternalModel:function(e,t,r){var i=this._internalModelsFor(e),a=new y.default(e,t,this,r);return i.add(a,t),a},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_removeFromIdMap:function(e){var t=this._internalModelsFor(e.modelName),r=e.id;t.remove(e,r)},adapterFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("adapter",t)},serializerFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this._pushedInternalModels=null,this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_updateRelationshipState:function(e){var t=this;1===this._updatedRelationships.push(e)&&this._backburner.join(function(){t._backburner.schedule("syncRelationships",t,t._flushUpdatedRelationships)})},_flushUpdatedRelationships:function(){for(var e=this._updatedRelationships,t=0,r=e.length;t<r;t++)e[t].flushCanonical();e.length=0},_updateInternalModel:function(e){1===this._updatedInternalModels.push(e)&&w.schedule("actions",this,this._flushUpdatedInternalModels)},_flushUpdatedInternalModels:function(){for(var e=this._updatedInternalModels,t=0,r=e.length;t<r;t++)e[t]._triggerDeferredTriggers();e.length=0},_pushResourceIdentifier:function(e,t){if(!E(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!E(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this._pushResourceIdentifier(e,t[i]);return r}}}),e.Store=I,e.default=I}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){return e.apply(void 0,r)}}function i(e,t){var r=e.finally(function(){t()||(r._subscribers.length=0)});return r}function a(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e.__esModule=!0,e._bind=r,e._guard=i,e._objectIsAlive=a;var n=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){e.__esModule=!0;var i=t.default.set,a=function(){function e(e,t){this._owner=e,this._store=t,this._namespaces={adapter:new r.default,serializer:new r.default}}return e.prototype.get=function(e,t){var r=this._namespaces[e];if(r[t])return r[t];var a=e+":"+t,n=this._instanceFor(a)||this._findInstance(e,this._fallbacksFor(e,t));return n&&(r[t]=n,i(n,"store",this._store)),r[t]},e.prototype._fallbacksFor=function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]},e.prototype._findInstance=function(e,t){for(var r=this._namespaces[e],i=0,a=t.length;i<a;i++){var n=t[i];if(r[n])return r[n];var o=e+":"+n,s=this._instanceFor(o);if(s)return r[n]=s,s}},e.prototype._instanceFor=function(e){return this._owner.lookup(e)},e.prototype.destroyCache=function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var a=t[r],n=e[a];n&&n.destroy()}},e.prototype.destroy=function(){this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this._namespaces=null,this._store=null,this._owner=null},e.prototype.toString=function(){return"ContainerInstanceCache"},e}();e.default=a}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,a,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=s.modelName,c=e.findRecord(t,r,o,l),h=(0,n.serializerForAdapter)(t,e,u),f="DS: Handle Adapter#findRecord of '"+u+"' with id: '"+o+"'";return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){var i=(0,a.normalizeResponseHelper)(h,t,r,e,o,"findRecord");return t._push(i)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+u+"'")}function s(e,r,o,s,d){var l=t.default.A(d).invoke("createSnapshot"),u=r.modelFor(o),c=e.findMany(r,u,s,l),h=(0,n.serializerForAdapter)(r,e,o),f="DS: Handle Adapter#findMany of '"+o+"'";if(void 0===c)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,r)),c.then(function(e){var t=(0,a.normalizeResponseHelper)(h,r,u,e,null,"findMany");return r._push(t)},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of '"+r.modelName+"' : '"+s.type+"'";return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),i=t._push(r);return i.meta=r.meta,i},null,"DS: Extract payload of '"+r.modelName+"' : hasMany '"+s.type+"'")}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r.modelName+" : "+s.type;return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");return r.data?t._push(r):null},null,"DS: Extract payload of "+r.modelName+" : "+s.type)}function u(e,t,r,o,s){var d=t.modelFor(r),l=t.peekAll(r),u=l._createSnapshot(s),c=e.findAll(t,d,o,u),h=(0,n.serializerForAdapter)(t,e,r),f="DS: Handle Adapter#findAll of "+d;return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){var i=(0,a.normalizeResponseHelper)(h,t,d,e,null,"findAll");return t._push(i),t.didUpdateAll(r),t.peekAll(r)},null,"DS: Extract payload of findAll ${modelName}")}function c(e,t,r,o,s){var d=t.modelFor(r),l=e.query(t,d,o,s),u=(0,n.serializerForAdapter)(t,e,r),c="DS: Handle Adapter#query of "+d;return l=p.resolve(l,c),l=(0,i._guard)(l,(0,i._bind)(i._objectIsAlive,t)),l.then(function(e){var r=(0,a.normalizeResponseHelper)(u,t,d,e,null,"query"),i=t._push(r);return s._setInternalModels(i,r),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=t.modelFor(r),d=e.queryRecord(t,s,o),l=(0,n.serializerForAdapter)(t,e,r),u="DS: Handle Adapter#queryRecord of "+r;return d=p.resolve(d,u),d=(0,i._guard)(d,(0,i._bind)(i._objectIsAlive,t)),d.then(function(e){var r=(0,a.normalizeResponseHelper)(l,t,s,e,null,"queryRecord");return t._push(r)},null,"DS: Extract payload of queryRecord "+r)}e.__esModule=!0,e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var p=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){var t=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&t.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):t.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||Array.isArray(e.data)||"object"==typeof e.data||t.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&t.push("meta must be an object"),"errors"in e&&(Array.isArray(e.errors)||t.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&t.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&t.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&t.push("included must be an array")):t.push("Top level of a JSON API document must be an object"),t}function a(e,t,r,i,a,n){var o=e.normalizeResponse(t,r,i,a,n);return o}e.__esModule=!0,e.validateDocumentStructure=i,e.normalizeResponseHelper=a}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.__esModule=!0,e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,i,a,n){e.__esModule=!0,e.BooleanTransform=e.StringTransform=e.DateTransform=e.NumberTransform=e.Transform=void 0,e.Transform=t.default,e.NumberTransform=r.default,e.DateTransform=i.default,e.StringTransform=a.default,e.BooleanTransform=n.default}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform"],function(e,t,r){e.__esModule=!0;var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return i(e)&&t.allowNull===!0?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return i(e)&&t.allowNull===!0?null:Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r){e.__esModule=!0,e.default=r.default.extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date((0,t.parseDate)(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date&&!isNaN(e)?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-(1/0)}e.__esModule=!0;var a=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t=void 0;return a(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t=void 0;return a(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){e.__esModule=!0;var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e){return i(e)?null:String(e)},serialize:function(e){return i(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return a(e,"attributes").has("type")||a(e,"relationshipsByName").has("type")}function i(e){var r=void 0;return t.default.getOwner?r=t.default.getOwner(e):e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}e.__esModule=!0,e.getOwner=e.modelHasAttributeOrRelationshipNamedType=void 0;var a=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function i(e){var i=new t.default;return e?(e.split(a).forEach(function(e){var t=e.split(":"),a=r(t),n=a[0],o=a.slice(1);n=n.trim(),(o=o.join(":").trim())&&(i[n]=o)}),i):i}e.__esModule=!0,e.default=i;var a="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return e.serialize(t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i){function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Adapter operation failed";this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){return o(e,(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).message)}}function o(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),p&&(r.extend=n(r)),r}function s(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var a=t.default.makeArray(e[i]),n=0;n<a.length;n++){var o="Invalid Attribute",s="/data/attributes/"+i;i===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:a[n],source:{pointer:s}})}}),r}function d(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:e.source.pointer.search(c)!==-1&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.__esModule=!0,e.ServerError=e.ConflictError=e.NotFoundError=e.ForbiddenError=e.UnauthorizedError=e.AbortError=e.TimeoutError=e.InvalidError=void 0,e.AdapterError=a,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",p=!1;p=!0,a.prototype=Object.create(l.prototype),p&&(a.extend=n(a));e.InvalidError=o(a,"The adapter rejected the commit because it was invalid"),e.TimeoutError=o(a,"The adapter operation timed out"),e.AbortError=o(a,"The adapter operation was aborted"),e.UnauthorizedError=p?o(a,"The adapter operation is unauthorized"):null,e.ForbiddenError=p?o(a,"The adapter operation is forbidden"):null,e.NotFoundError=p?o(a,"The adapter could not find the resource"):null,e.ConflictError=p?o(a,"The adapter operation failed due to a conflict"):null,e.ServerError=p?o(a,"The adapter operation failed due to a server error"):null}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a){e.__esModule=!0;var n=r.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var a=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),a&&a(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,a){if((0,i.default)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var n=this.buildURL(t.modelName,r,a,"findMany");return this.ajax(n,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t.default.String.dasherize(e);return t.default.String.pluralize(r)},updateRecord:function(e,t,r){if((0,i.default)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,r,{includeId:!0});var n=this.buildURL(t.modelName,r.id,r,"updateRecord");return this.ajax(n,"PATCH",{data:a})},_hasCustomizedAjax:function(){return this.ajax!==n.prototype.ajax||this.ajaxOptions!==n.prototype.ajaxOptions}});(0,i.default)("ds-improved-ajax")&&n.reopen({methodForRequest:function(e){return"updateRecord"===e.requestType?"PATCH":this._super.apply(this,arguments)},dataForRequest:function(e){var t=e.requestType,r=e.ids;if("findMany"===t)return{filter:{id:r.join(",")}};if("updateRecord"===t){var i=e.store,a=e.type,n=e.snapshot,o={};return i.serializerFor(a.modelName).serializeIntoHash(o,a,n,{includeId:!0}),o}return this._super.apply(this,arguments)},headersForRequest:function(){var e=this._super.apply(this,arguments)||{};return e.Accept="application/vnd.api+json",e},_requestToJQueryAjaxHash:function(){var e=this._super.apply(this,arguments);return e.contentType&&(e.contentType="application/vnd.api+json"),e}}),e.default=n}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,i,a,n,o,s){function d(e,t,r,i){var a=void 0;try{a=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),r,i)}catch(e){return p.reject(e)}return a&&a.isAdapterError?p.reject(a):a}function l(e,t,r,a){var n=void 0;if(a.errorThrown instanceof Error)n=a.errorThrown;else if("timeout"===a.textStatus)n=new i.TimeoutError;else if("abort"===a.textStatus||0===t.status)n=new i.AbortError;else try{n=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||a.errorThrown,r)}catch(e){n=e}return n}function u(e,t){return"function"!=typeof String.prototype.endsWith?e.indexOf(t,e.length-t.length)!==-1:e.endsWith(t)}e.__esModule=!0;var c=t.default.MapWithDefault,h=t.default.get,p=t.default.RSVP.Promise,f=r.default.extend(a.default,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},a=t.sort(),n=0;n<r;n++)i[a[n]]=e[a[n]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,id:r,snapshot:i,requestType:"findRecord"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,i,"findRecord"),s=this.buildQuery(i);return this.ajax(o,"GET",{data:s})},findAll:function(e,t,r,i){var a=this.buildQuery(i);if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var o=this._requestFor({store:e,type:t,sinceToken:r,query:a,snapshots:i,requestType:"findAll"});return this._makeRequest(o)}var s=this.buildURL(t.modelName,null,i,"findAll");return r&&(a.since=r),this.ajax(s,"GET",{data:a})},query:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,query:r,requestType:"query"});return this._makeRequest(i)}var a=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},queryRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,query:r,requestType:"queryRecord"});return this._makeRequest(i)}var a=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},findMany:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,ids:r,snapshots:i,requestType:"findMany"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(o,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:i,requestType:"findHasMany"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:i,requestType:"findBelongsTo"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,snapshot:r,requestType:"createRecord"});return this._makeRequest(i)}var a={},o=e.serializerFor(t.modelName),s=this.buildURL(t.modelName,null,r,"createRecord");return o.serializeIntoHash(a,t,r,{includeId:!0}),this.ajax(s,"POST",{data:a})},updateRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,snapshot:r,requestType:"updateRecord"});return this._makeRequest(i)}var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,r);var o=r.id,s=this.buildURL(t.modelName,o,r,"updateRecord");return this.ajax(s,"PUT",{data:a})},deleteRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,snapshot:r,requestType:"deleteRecord"});return this._makeRequest(i)}var a=r.id;return this.ajax(this.buildURL(t.modelName,a,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),a=i[i.length-1],n=t.id;return decodeURIComponent(a)===n?i[i.length-1]="":u(a,"?id="+n)&&(i[i.length-1]=a.substring(0,a.length-n.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var n=0,o=a._stripIDFromURL(e,t[0]),s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;o.length+n+t>=r&&(n=0,s.push([])),n+=t,s[s.length-1].push(e)}),s}var i=c.create({defaultValue:function(){return[]}}),a=this,n=this.maxURLLength;t.forEach(function(t){var r=a._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){r(e,n,"&ids%5B%5D=".length).forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,a){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,a);switch(e){case 401:return new i.UnauthorizedError(n,o);case 403:return new i.ForbiddenError(n,o);case 404:return new i.NotFoundError(n,o);case 409:return new i.ConflictError(n,o);default:if(e>=500)return new i.ServerError(n,o)}return new i.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var a=this,n={url:e,method:r};return new p(function(o,s){var u=a.ajaxOptions(e,r,i);u.success=function(e,r,i){var s=d(a,i,e,n);t.default.run.join(null,o,s)},u.error=function(e,r,i){var o={textStatus:r,errorThrown:i},d=l(a,e,n,o);t.default.run.join(null,s,d)},a._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t.default.$.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var a=h(this,"headers");return void 0!==a&&(i.beforeSend=function(e){Object.keys(a).forEach(function(t){return e.setRequestHeader(t,a[t])})}),i},parseErrorResponse:function(e){var r=e;try{r=t.default.$.parseJSON(e)}catch(e){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,i){var a=void 0,n=t["Content-Type"]||"Empty Content-Type";return a="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+n+")",a].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==f.prototype.ajax||this.ajaxOptions!==f.prototype.ajaxOptions}});(0,n.default)("ds-improved-ajax")&&f.reopen({dataForRequest:function(e){var t=e.store,r=e.type,i=e.snapshot,a=e.requestType,n=e.query;r=r||i&&i.type;var o=t.serializerFor(r.modelName),s={};switch(a){case"createRecord":o.serializeIntoHash(s,r,i,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,i);break;case"findRecord":s=this.buildQuery(i);break;case"findAll":e.sinceToken&&(n=n||{},n.since=e.sinceToken),s=n;break;case"query":case"queryRecord":this.sortQueryParams&&(n=this.sortQueryParams(n)),s=n;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){switch(e.requestType){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,i=e.ids,a=e.snapshot,n=e.snapshots,o=e.requestType,s=e.query;switch(t=t||a&&a.type,r=r||a&&a.id,o){case"findAll":return this.buildURL(t.modelName,null,n,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,i,n,o);case"findHasMany":case"findBelongsTo":var d=this.buildURL(t.modelName,r,a,o);return this.urlPrefix(e.url,d)}return this.buildURL(t.modelName,r,a,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){return{method:this.methodForRequest(e),url:this.urlForRequest(e),headers:this.headersForRequest(e),data:this.dataForRequest(e)}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.method?(t.contentType="application/json; charset=utf-8",t.data=JSON.stringify(e.data)):t.data=e.data);var r=e.headers;return void 0!==r&&(t.beforeSend=function(e){Object.keys(r).forEach(function(t){return e.setRequestHeader(t,r[t])})}),t},_makeRequest:function(e){var r=this,i=this._requestToJQueryAjaxHash(e),a=e.method,n=e.url,o={method:a,url:n};return new t.default.RSVP.Promise(function(e,a){i.success=function(i,a,n){var s=d(r,n,i,o);t.default.run.join(null,e,s)},i.error=function(e,i,n){var s={textStatus:i,errorThrown:n},d=l(r,e,o,s);t.default.run.join(null,a,d)},r._ajaxRequest(i)},"DS: RESTAdapter#makeRequest: "+a+" "+n)}}),e.default=f}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t,r){return"function"==typeof t.defaultValue?t.defaultValue.apply(null,arguments):t.defaultValue}function a(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t.default.computed({get:function(e){var t=this._internalModel;return a(t,e)?n(t,e):i(this,r,e)},set:function(e,t){var r=this._internalModel,i=n(r,e),a=void 0;return t!==i&&(r._attributes[e]=t,a=e in r._inFlightAttributes?r._inFlightAttributes[e]:r._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:i,originalValue:a,value:t})),t}}).meta(o)}e.__esModule=!0,e.default=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/global","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/relationships/state/relationship","ember-inflector"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,p,f,m,y,v,b,_,g,R,A,M,F,z,T,k){if(e.__esModule=!0,t.default.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t.default.Error("Ember Data requires at least Ember 1.13.0, but you have "+t.default.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");n.default.Store=l.Store,n.default.PromiseArray=d.PromiseArray,n.default.PromiseObject=d.PromiseObject,n.default.PromiseManyArray=d.PromiseManyArray,n.default.Model=c.default,n.default.RootState=u.RootState,n.default.attr=u.attr,n.default.Errors=u.Errors,n.default.InternalModel=s.default,n.default.Snapshot=h.default,n.default.Adapter=p.default,n.default.AdapterError=m.AdapterError,n.default.InvalidError=m.InvalidError,n.default.TimeoutError=m.TimeoutError,n.default.AbortError=m.AbortError,n.default.UnauthorizedError=m.UnauthorizedError,n.default.ForbiddenError=m.ForbiddenError,n.default.NotFoundError=m.NotFoundError,n.default.ConflictError=m.ConflictError,n.default.ServerError=m.ServerError,n.default.errorsHashToArray=m.errorsHashToArray,n.default.errorsArrayToHash=m.errorsArrayToHash,n.default.Serializer=f.default,n.default.DebugAdapter=r.default,n.default.RecordArray=y.RecordArray,n.default.FilteredRecordArray=y.FilteredRecordArray,n.default.AdapterPopulatedRecordArray=y.AdapterPopulatedRecordArray,n.default.ManyArray=v.default,n.default.RecordArrayManager=b.default,n.default.RESTAdapter=_.RESTAdapter,n.default.BuildURLMixin=g.default,n.default.RESTSerializer=R.RESTSerializer,n.default.JSONSerializer=R.JSONSerializer,n.default.JSONAPIAdapter=_.JSONAPIAdapter,n.default.JSONAPISerializer=R.JSONAPISerializer,n.default.Transform=M.Transform,n.default.DateTransform=M.DateTransform,n.default.StringTransform=M.StringTransform,n.default.NumberTransform=M.NumberTransform,n.default.BooleanTransform=M.BooleanTransform,n.default.EmbeddedRecordsMixin=A.default,n.default.belongsTo=F.belongsTo,n.default.hasMany=F.hasMany,n.default.Relationship=k.default,n.default._setupContainer=z.default,n.default._initializeStoreService=T.default,Object.defineProperty(n.default,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:o.default}),Object.defineProperty(a.default,"DS",{configurable:!0,get:function(){return n.default}}),e.default=n.default}),t("ember-data/initializers/data-adapter",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data/index"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports","ember"],function(e,t){e.__esModule=!0,
|
5
|
-
e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e.__esModule=!0,e.default=t.default}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.__esModule=!0,e.hasMany=e.belongsTo=void 0,e.belongsTo=t.default,e.hasMany=r.default}),t("ember-data/serializer",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.__esModule=!0;var a=t.default.get,n=t.default.set,o=t.default.String.camelize;e.default=t.default.Mixin.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var a=this.hasSerializeIdsOption(i),n=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(a){var s=this._getMappedKey(r.key,e.type);s===r.key&&this.keyForRelationship&&(s=this.keyForRelationship(r.key,r.kind,"serialize")),o?(t[s]=o.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[s]=null}else n&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[a]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[a]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[a]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,i){var a=this.keyForAttribute(i.key,"serialize"),n=e.hasMany(i.key);r[a]=t.default.A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var i=e.hasMany(r.key),a=t.default.A(i),n=new Array(a.length),o=0;o<a.length;o++){var s=a[o],d=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,i){if("belongsTo"===r.kind){var a=e.type.inverseFor(r.key,this.store);if(a){var n=a.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,a.kind,"deserialize");s&&delete i[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},hasSerializeIdsAndTypesOption:function(e){var t=this.attrsOption(e);return t&&("ids-and-types"===t.serialize||"id-and-type"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[o(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var a=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&a._extractEmbeddedHasMany(t,r,i,n),"belongsTo"===n.kind&&a._extractEmbeddedBelongsTo(t,r,i,n))}),i},_extractEmbeddedHasMany:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,o,u),h=c.data,p=c.included;if(r.included=r.included||[],r.included.push(h),p){var f;(f=r.included).push.apply(f,i(p))}d[l]={id:h.id,type:h.type}}n(r,"data.relationships."+t,{data:d})}},_extractEmbeddedBelongsTo:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,o,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,i(u))}n(r,"data.relationships."+t,{data:{id:l.id,type:l.type}})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var a=e.modelFor(i);return e.serializerFor(i).normalize(a,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-inflector","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-data/-private/features"],function(e,t,r,i,a,n,o){e.__esModule=!0;var s=t.default.String.dasherize,d=a.default.extend({_normalizeDocumentHelper:function(e){if("object"===t.default.typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeResourceHelper(a)}e.data=r}if(Array.isArray(e.included)){for(var n=new Array(e.included.length),o=0;o<e.included.length;o++){var s=e.included[o];n[o]=this._normalizeResourceHelper(s)}e.included=n}return e},_normalizeRelationshipDataHelper:function(e){if((0,o.default)("ds-payload-type-hooks")){var t=this.modelNameFromPayloadType(e.type),r=this.modelNameFromPayloadKey(e.type);t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r),e.type=t}else e.type=this.modelNameFromPayloadKey(e.type);return e},_normalizeResourceHelper:function(e){var t=void 0;if((0,o.default)("ds-payload-type-hooks")){t=this.modelNameFromPayloadType(e.type);var r=this.modelNameFromPayloadKey(e.type);"modelNameFromPayloadType",t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r,"modelNameFromPayloadKey")}else t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey";if(!this.store._hasModelFor(t))return null;var i=this.store._modelFor(t);return this.store.serializerFor(t).normalize(i,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);if((0,o.default)("ds-pushpayload-return"))return e.push(r);e.push(r)},_normalizeResponse:function(e,t,r,i,a,n){return this._normalizeDocumentHelper(r)},normalizeQueryRecordResponse:function(){return this._super.apply(this,arguments)},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var a=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[a]&&(i[e]=t.attributes[a])}),i},extractRelationship:function(e){if("object"===t.default.typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeRelationshipDataHelper(a)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,a){var n=r.keyForRelationship(e,a.kind,"deserialize");if(void 0!==t.relationships[n]){var o=t.relationships[n];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){if((0,o.default)("ds-payload-type-hooks")){var r=this.modelNameFromPayloadType(t.type),i=this.modelNameFromPayloadKey(t.type);return r!==i&&this._hasCustomModelNameFromPayloadKey()&&(r=i),r}return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.default)(e))},payloadKeyFromModelName:function(e){return(0,r.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),i=void 0;if((0,o.default)("ds-payload-type-hooks")){i=this.payloadTypeFromModelName(e.modelName);var a=this.payloadKeyFromModelName(e.modelName);i!==a&&this._hasCustomPayloadKeyFromModelName()&&(i=a)}else i=this.payloadKeyFromModelName(e.modelName);return r.type=i,{data:r}},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(a){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i);if(void 0!==a){t.relationships=t.relationships||{};var n=this._getMappedKey(i,e.type);n===i&&(n=this.keyForRelationship(i,"belongsTo","serialize"));var s=null;if(a){var d=void 0;if((0,o.default)("ds-payload-type-hooks")){d=this.payloadTypeFromModelName(a.modelName);var l=this.payloadKeyFromModelName(a.modelName);d!==l&&this._hasCustomPayloadKeyFromModelName()&&(d=l)}else d=this.payloadKeyFromModelName(a.modelName);s={type:d,id:a.id}}t.relationships[n]={data:s}}}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(a="shouldSerializeHasMany",this[a](e,i,r)){var n=e.hasMany(i);if(void 0!==n){t.relationships=t.relationships||{};var s=this._getMappedKey(i,e.type);s===i&&this.keyForRelationship&&(s=this.keyForRelationship(i,"hasMany","serialize"));for(var d=new Array(n.length),l=0;l<n.length;l++){var u=n[l],c=void 0;if((0,o.default)("ds-payload-type-hooks")){c=this.payloadTypeFromModelName(u.modelName);var h=this.payloadKeyFromModelName(u.modelName);c!==h&&this._hasCustomPayloadKeyFromModelName()&&(c=h)}else c=this.payloadKeyFromModelName(u.modelName);d[l]={type:c,id:u.id}}t.relationships[s]={data:d}}}}});(0,o.default)("ds-payload-type-hooks")&&d.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.default)(e))},payloadTypeFromModelName:function(e){return(0,r.pluralize)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==d.prototype.modelNameFromPayloadKey},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==d.prototype.payloadKeyFromModelName}}),e.default=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/features","ember-data/adapters/errors"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.__esModule=!0;var u=t.default.get,c=t.default.isNone,h=t.default.assign||t.default.merge,p=i.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=u(e,"attributes");return e.eachTransformedAttribute(function(e,a){if(void 0!==t[e]){var n=r.transformFor(a),o=i.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,a){switch(a){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!0)},normalizeArrayResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!1)},_normalizeResponse:function(e,t,r,i,a,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;p<f;p++){var m=r[p],y=this.normalize(t,m),v=y.data,b=y.included;if(b){var _;(_=o.included).push.apply(_,l(b))}h[p]=v}o.data=h}return o},normalize:function(e,r){var i=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t.default.typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),i={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,i.attributes)),{data:i}},extractId:function(e,t){var r=u(this,"primaryKey"),i=t[r];return(0,a.default)(i)},extractAttributes:function(e,t){var r=this,i=void 0,a={};return e.eachAttribute(function(e){i=r.keyForAttribute(e,"deserialize"),void 0!==t[i]&&(a[e]=t[i])}),a},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,a.default)(r.id));var i=this.store.modelFor(e);if(r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(i))if((0,s.default)("ds-payload-type-hooks")){var n=this.modelNameFromPayloadType(r.type),d=this.modelNameFromPayloadKey(r.type);n!==d&&this._hasCustomModelNameFromPayloadKey()&&(n=d),r.type=n}else r.type=this.modelNameFromPayloadKey(r.type);return r}return{id:(0,a.default)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var i=this,a={};return e.eachRelationship(function(e,n){var o=null,s=i.keyForRelationship(e,n.kind,"deserialize");if(void 0!==r[s]){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t.default.isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;u<c;u++){var h=l[u];d[u]=i.extractRelationship(n.type,h)}}o={data:d}}var p=i.keyForLink(e,n.kind);if(r.links&&void 0!==r.links[p]){var f=r.links[p];o=o||{},o.links={related:f}}o&&(a[e]=o)}),a},modelNameFromPayloadKey:function(e){return(0,n.default)(e)},normalizeRelationships:function(e,t){var r=this,i=void 0;this.keyForRelationship&&e.eachRelationship(function(e,a){i=r.keyForRelationship(e,a.kind,"deserialize"),e!==i&&void 0!==t[i]&&(t[e]=t[i],delete t[i])})},normalizeUsingDeclaredMapping:function(e,t){var r=u(this,"attrs"),i=void 0,a=void 0;if(r)for(var n in r)i=a=this._getMappedKey(n,e),void 0!==t[a]&&(u(e,"attributes").has(n)&&(i=this.keyForAttribute(n)),u(e,"relationshipsByName").has(n)&&(i=this.keyForRelationship(n)),a!==i&&(t[i]=t[a],delete t[a]))},_getMappedKey:function(e,t){var r=u(this,"attrs"),i=void 0;return r&&r[e]&&(i=r[e],i.key&&(i=i.key),"string"==typeof i&&(e=i)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||t[e].serialize!==!1},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&t[e].serialize===!0},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany,p.prototype._shouldSerializeHasMany,this._shouldSerializeHasMany(e,t,r)},_shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var r=this,i={};if(t&&t.includeId)if((0,s.default)("ds-serialize-id"))this.serializeId(e,i,u(this,"primaryKey"));else{var a=e.id;a&&(i[u(this,"primaryKey")]=a)}return e.eachAttribute(function(t,a){r.serializeAttribute(e,i,t,a)}),e.eachRelationship(function(t,a){"belongsTo"===a.kind?r.serializeBelongsTo(e,i,a):"hasMany"===a.kind&&r.serializeHasMany(e,i,a)}),i},serializeIntoHash:function(e,t,r,i){h(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){if(this._canSerialize(r)){var a=i.type,n=e.attr(r);if(a){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i,{id:!0}),n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"belongsTo","serialize")),c(a)?t[n]=null:t[n]=a,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(a="shouldSerializeHasMany",this[a](e,i,r)){var n=e.hasMany(i,{ids:!0});if(void 0!==n){var o=this._getMappedKey(i,e.type);o===i&&this.keyForRelationship&&(o=this.keyForRelationship(i,"hasMany","serialize")),t[o]=n}}},serializePolymorphicType:function(){},extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,r,i){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,d.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){return(0,o.getOwner)(this).lookup("transform:"+e)}});(0,s.default)("ds-payload-type-hooks")&&p.reopen({modelNameFromPayloadType:function(e){return(0,n.default)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==p.prototype.modelNameFromPayloadKey}}),(0,s.default)("ds-serialize-id")&&p.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),e.default=p}),t("ember-data/serializers/rest",["exports","ember","ember-inflector","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.__esModule=!0;var u=t.default.String.camelize,c=a.default.extend({keyForPolymorphicType:function(e,t,r){return this.keyForRelationship(e)+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,i,a){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,d),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=a,o=i;if(!(0,s.modelHasAttributeOrRelationshipNamedType)(i)&&t.type){var l=void 0;if((0,d.default)("ds-payload-type-hooks")){l=this.modelNameFromPayloadType(t.type);var u=this.modelNameFromPayloadKey(t.type);l!==u&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(l=u)}else l=this.modelNameFromPayloadKey(t.type);e._hasModelFor(l)&&(n=e.serializerFor(l),o=e.modelFor(l))}return n.normalize(o,t,r)},_normalizeResponse:function(e,r,i,a,n,s){var d=this,u={data:null,included:[]},c=this.extractMeta(e,r,i);c&&(u.meta=c);for(var h=Object.keys(i),p=0,f=h.length;p<f;p++){(function(n,c){var p=h[n],f=p,m=!1;"_"===p.charAt(0)&&(m=!0,f=p.substr(1));var y=d.modelNameFromPayloadKey(f);if(!e.modelFactoryFor(y))return"continue";var v=!m&&d.isPrimaryType(e,y,r),b=i[p];if(null===b)return"continue";if(v&&"array"!==t.default.typeOf(b)){var _=d._normalizePolymorphicRecord(e,b,p,r,d),g=_.data,R=_.included;if(u.data=g,R){var A;(A=u.included).push.apply(A,l(R))}return"continue"}var M=d._normalizeArray(e,y,b,p),F=M.data,z=M.included;if(z){var T;(T=u.included).push.apply(T,l(z))}if(s)F.forEach(function(e){var t=v&&(0,o.default)(e.id)===a;v&&!a&&!u.data||t?u.data=e:u.included.push(e)});else if(v)u.data=F;else if(F){var k;(k=u.included).push.apply(k,l(F))}})(p)}return u},isPrimaryType:function(e,t,r){return e.modelFor(t)===r},pushPayload:function(e,r){var i=this,a={data:[],included:[]};for(var n in r){(function(n){var o=i.modelNameFromPayloadKey(n);if(!e.modelFactoryFor(o))return"continue";var s=e.modelFor(o),d=e.serializerFor(s.modelName);t.default.makeArray(r[n]).forEach(function(e){var t=d.normalize(s,e,n),r=t.data,i=t.included;if(a.data.push(r),i){var o;(o=a.included).push.apply(o,l(i))}})})(n)}if((0,d.default)("ds-pushpayload-return"))return e.push(a);e.push(a)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.default)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){e[this.payloadKeyFromModelName(t.modelName)]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,i){var a=i.key,n=this.keyForPolymorphicType(a,i.type,"serialize"),o=e.belongsTo(a);a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==n&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(n=a),t.default.isNone(o)?r[n]=null:(0,d.default)("ds-payload-type-hooks")?r[n]=this.payloadTypeFromModelName(o.modelName):r[n]=u(o.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(i,e,"deserialize");if(o&&void 0!==a[s]&&"object"!=typeof t){if((0,d.default)("ds-payload-type-hooks")){var l=a[s],u=this.modelNameFromPayloadType(l),c=this.modelNameFromPayloadKey(l);return l!==c&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(u=c),{id:t,type:u}}return{id:t,type:this.modelNameFromPayloadKey(a[s])}}return this._super.apply(this,arguments)}});(0,d.default)("ds-payload-type-hooks")&&c.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.default)(e))},payloadTypeFromModelName:function(e){return u(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==c.prototype.modelNameFromPayloadKey},_hasCustomModelNameFromPayloadType:function(){return this.modelNameFromPayloadType!==c.prototype.modelNameFromPayloadType},_hasCustomPayloadTypeFromModelName:function(){return this.payloadTypeFromModelName!==c.prototype.payloadTypeFromModelName},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==c.prototype.payloadKeyFromModelName}}),e.default=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,i,a){function n(e){(0,a.default)(e),(0,r.default)(e),(0,i.default)(e),(0,t.default)(e)}e.__esModule=!0,e.default=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e.__esModule=!0,e.default=t.default}),t("ember-data/transform",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.__esModule=!0,e.default="2.13.0-beta.3"}),t("ember-inflector",["module","exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,a){r.__esModule=!0,r.defaultRules=r.singularize=r.pluralize=void 0,a.Inflector.defaultRules=a.defaultRules,i.default.Inflector=a.Inflector,i.default.String.pluralize=a.pluralize,i.default.String.singularize=a.singularize,r.default=a.Inflector,r.pluralize=a.pluralize,r.singularize=a.singularize,r.defaultRules=a.defaultRules,void 0!==t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=a.Inflector,e.pluralize=a.pluralize,e.singularize=a.singularize,e}):void 0!==e&&e.exports&&(e.exports=a.Inflector,a.Inflector.singularize=a.singularize,a.Inflector.pluralize=a.pluralize)}),t("ember-inflector/lib/ext/string",["ember","ember-inflector/lib/system/string"],function(e,t){(e.default.EXTEND_PROTOTYPES===!0||e.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,t.pluralize)(this)},String.prototype.singularize=function(){return(0,t.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e){var r=void 0,i=void 0;return 1===e.length?(i=e[0],(0,t.pluralize)(i)):(r=e[0],i=e[1],1!==parseFloat(r)&&(i=(0,t.pluralize)(i)),r+" "+i)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,i){e.__esModule=!0,e.defaultRules=e.pluralize=e.singularize=e.Inflector=void 0,t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.__esModule=!0,e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status|bonus)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(buffal|tomat)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh)$/i,"$1es"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/^(m|l)ouse$/i,"$1ice"],[/^(m|l)ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"]],singular:[[/s$/i,""],[/(ss)$/i,"$1"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"],[/(^analy)(sis|ses)$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/(hive)s$/i,"$1"],[/(tive)s$/i,"$1"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/(x|ch|ss|sh)es$/i,"$1"],[/^(m|l)ice$/i,"$1ouse"],[/(bus)(es)?$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|test)(is|es)$/i,"$1is"],[/^(a)x[ie]s$/i,"$1xis"],[/(octop|vir)(us|i)$/i,"$1us"],[/(alias|status|bonus)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),t("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function i(e,t){for(var r,i=0,a=t.length;i<a;i++)r=t[i],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function a(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}e.__esModule=!0;var o=t.default.String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");a.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),i(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var i,a,n,c,h,p,f,m;if(p=!e||s.test(e),f=u.test(e),"",p)return e;if(n=e.toLowerCase(),c=d.exec(e)||l.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[n]||this.rules.uncountable[h])return e;for(m in r)if(n.match(m+"$"))return a=r[m],f&&r[h]&&(a=o(a),m=o(m)),e.replace(new RegExp(m,"i"),a);for(var y=t.length;y>0&&(i=t[y-1],m=i[0],!m.test(e));y--);
|
6
|
-
return i=i||[],m=i[0],a=i[1],e.replace(m,a)}},e.default=a}),t("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t.default.inflector.pluralize(e)}function i(e){return t.default.inflector.singularize(e)}e.__esModule=!0,e.singularize=e.pluralize=void 0,e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t.default.Helper?t.default.Helper.helper(e):t.default.HTMLBars?t.default.HTMLBars.makeBoundHelper(e):t.default.Handlebars.makeBoundHelper(e)}e.__esModule=!0,e.default=r}),t("ember-load-initializers",["exports"],function(e){function t(e){var t=i(e,null,null,!0);if(!t)throw new Error(e+" must export an initializer.");var r=t.default;return r.name||(r.name=e.slice(e.lastIndexOf("/")+1)),r}function r(e,r){for(var i=0;i<r.length;i++)e.initializer(t(r[i]))}function n(e,r){for(var i=0;i<r.length;i++)e.instanceInitializer(t(r[i]))}e.__esModule=!0,e.default=function(e,t){for(var i=t+"/initializers/",o=t+"/instance-initializers/",s=[],d=[],l=Object.keys(a._eak_seen),u=0;u<l.length;u++){var c=l[u];0===c.lastIndexOf(i,0)?s.push(c):0===c.lastIndexOf(o,0)&&d.push(c)}r(e,s),n(e,d)}}),t("ember",[],function(){return{default:Ember}}),i("ember-data"),i("ember-load-initializers").default(Ember.Application,"ember-data"),function(){var e=i("ember-data/-private/global").default,t=i("ember-data").default;Object.defineProperty(e,"DS",{get:function(){return t}})}()}).call(this),function(){function e(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&function(){var t={"ember-data":{default:DS},"ember-data/model":{default:DS.Model},"ember-data/mixins/embedded-records":{default:DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{default:DS.RESTSerializer},"ember-data/serializers/active-model":{default:DS.ActiveModelSerializer},"ember-data/serializers/json":{default:DS.JSONSerializer},"ember-data/serializers/json-api":{default:DS.JSONAPISerializer},"ember-data/serializer":{default:DS.Serializer},"ember-data/adapters/json-api":{default:DS.JSONAPIAdapter},"ember-data/adapters/rest":{default:DS.RESTAdapter},"ember-data/adapter":{default:DS.Adapter},"ember-data/adapters/active-model":{default:DS.ActiveModelAdapter},"ember-data/store":{default:DS.Store},"ember-data/transform":{default:DS.Transform},"ember-data/attr":{default:DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in t)e(r,t[r])}()}();
|
1
|
+
(function(){"use strict";var e,t,r,i,a;!function(n){function o(){var e=Object.create(null);return e.__=void 0,delete e.__,e}function s(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function d(e,t,r,i){this.id=b++,this.name=e,this.deps=!t.length&&r.length?_:t,this.module={exports:{}},this.callback=r,this.hasExportsAsDep=!1,this.isAlias=i,this.reified=new Array(t.length),this.state="new"}function l(e){this.name=e}function u(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function c(e,t,r){for(var i=y[e]||y[e+"/index"];i&&i.isAlias;)i=y[i.name];return i||u(e,t),r&&"pending"!==i.state&&"finalized"!==i.state&&(i.findDeps(r),r.push(i)),i}function h(e,t){if("."!==e.charAt(0))return e;for(var r=e.split("/"),i=t.split("/"),a=i.slice(0,-1),n=0,o=r.length;n<o;n++){var s=r[n];if(".."===s){if(0===a.length)throw new Error("Cannot access parent module of root");a.pop()}else{if("."===s)continue;a.push(s)}}return a.join("/")}function p(e){return!(!y[e]&&!y[e+"/index"])}var f=(n.heimdall,{loader:e,define:t,requireModule:r,require:i,requirejs:a});a=i=r=function(e){for(var t=[],r=c(e,"(require)",t),i=t.length-1;i>=0;i--)t[i].exports();return r.module.exports},e={noConflict:function(e){var t,r;for(t in e)e.hasOwnProperty(t)&&f.hasOwnProperty(t)&&(r=e[t],n[r]=n[t],n[t]=f[t])}};var m;m=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var y=o(),v=o(),b=0,_=["require","exports","module"];d.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||!Object.isExtensible(e)||(e.default=e)},d.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;e.wrapModules&&(this.callback=e.wrapModules(this.name,this.callback)),this.reify();var t=this.callback.apply(this,this.reified);return this.state="finalized",this.hasExportsAsDep&&void 0===t||(this.module.exports=t),this.makeDefaultExport(),this.module.exports},d.prototype.unsee=function(){this.state="new",this.module={exports:{}}},d.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},d.prototype._reify=function(){for(var e=this.reified.slice(),t=0;t<e.length;t++){var r=e[t];e[t]=r.exports?r.exports:r.module.exports()}return e},d.prototype.findDeps=function(e){if("new"===this.state){this.state="pending";for(var t=this.deps,r=0;r<t.length;r++){var i=t[r],a=this.reified[r]={exports:void 0,module:void 0};"exports"===i?(this.hasExportsAsDep=!0,a.exports=this.module.exports):"require"===i?a.exports=this.makeRequire():"module"===i?a.exports=this.module:a.module=c(h(i,this.name),this.name,e)}}},d.prototype.makeRequire=function(){var e=this.name,t=function(t){return i(h(t,e))};return t.default=t,t.has=function(t){return p(h(t,e))},t},t=function(e,t,r){var i=y[e];i&&"new"!==i.state||(arguments.length<2&&s(arguments.length),m(t)||(r=t,t=[]),y[e]=r instanceof l?new d(r.name,t,r,!0):new d(e,t,r,!1))},t.alias=function(e){return new l(e)},a.entries=a._eak_seen=y,a.has=p,a.unsee=function(e){c(e,"(unsee)",!1).unsee()},a.clear=function(){a.entries=a._eak_seen=y=o(),v=o()},t("foo",function(){}),t("foo/bar",[],function(){}),t("foo/asdf",["module","exports","require"],function(e,t,r){r.has("foo/bar")&&r("foo/bar")}),t("foo/baz",[],t.alias("foo")),t("foo/quz",t.alias("foo")),t("foo/bar",["foo","./quz","./baz","./asdf","./bar","../foo"],function(){}),t("foo/main",["foo/bar"],function(){}),i("foo/main"),i.unsee("foo/bar"),a.clear(),"object"==typeof exports&&"object"==typeof module&&module.exports&&(module.exports={require:i,define:t})}(this),t("ember-data/-private/adapters",["exports","ember-data/adapters/json-api","ember-data/adapters/rest"],function(e,t,r){e.__esModule=!0,e.RESTAdapter=e.JSONAPIAdapter=void 0,e.JSONAPIAdapter=t.default,e.RESTAdapter=r.default}),t("ember-data/-private/adapters/build-url-mixin",["exports","ember"],function(e,t){e.__esModule=!0;var r=t.default.get;e.default=t.default.Mixin.create({buildURL:function(e,t,r,i,a){switch(i){case"findRecord":return this.urlForFindRecord(t,e,r);case"findAll":return this.urlForFindAll(e,r);case"query":return this.urlForQuery(a,e);case"queryRecord":return this.urlForQueryRecord(a,e);case"findMany":return this.urlForFindMany(t,e,r);case"findHasMany":return this.urlForFindHasMany(t,e,r);case"findBelongsTo":return this.urlForFindBelongsTo(t,e,r);case"createRecord":return this.urlForCreateRecord(e,r);case"updateRecord":return this.urlForUpdateRecord(t,e,r);case"deleteRecord":return this.urlForDeleteRecord(t,e,r);default:return this._buildURL(e,t)}},_buildURL:function(e,t){var i=void 0,a=[],n=r(this,"host"),o=this.urlPrefix();return e&&(i=this.pathForType(e))&&a.push(i),t&&a.push(encodeURIComponent(t)),o&&a.unshift(o),a=a.join("/"),!n&&a&&"/"!==a.charAt(0)&&(a="/"+a),a},urlForFindRecord:function(e,t,r){return this._buildURL(t,e)},urlForFindAll:function(e,t){return this._buildURL(e)},urlForQuery:function(e,t){return this._buildURL(t)},urlForQueryRecord:function(e,t){return this._buildURL(t)},urlForFindMany:function(e,t,r){return this._buildURL(t)},urlForFindHasMany:function(e,t,r){return this._buildURL(t,e)},urlForFindBelongsTo:function(e,t,r){return this._buildURL(t,e)},urlForCreateRecord:function(e,t){return this._buildURL(e)},urlForUpdateRecord:function(e,t,r){return this._buildURL(t,e)},urlForDeleteRecord:function(e,t,r){return this._buildURL(t,e)},urlPrefix:function(e,t){var i=r(this,"host"),a=r(this,"namespace");if(i&&"/"!==i||(i=""),e)return/^\/\//.test(e)||/http(s)?:\/\//.test(e)?e:"/"===e.charAt(0)?""+i+e:t+"/"+e;var n=[];return i&&n.push(i),a&&n.push(a),n.join("/")},pathForType:function(e){var r=t.default.String.camelize(e);return t.default.String.pluralize(r)}})}),t("ember-data/-private/core",["exports","ember","ember-data/version"],function(e,t,r){e.__esModule=!0;var i=t.default.Namespace.create({VERSION:r.default,name:"DS"});t.default.libraries&&t.default.libraries.registerCoreLibrary("Ember Data",i.VERSION),e.default=i}),t("ember-data/-private/debug",["exports","ember"],function(e,t){function r(){return t.default.assert.apply(t.default,arguments)}function i(){return t.default.debug.apply(t.default,arguments)}function a(){return t.default.deprecate.apply(t.default,arguments)}function n(){return t.default.info.apply(t.default,arguments)}function o(){return t.default.runInDebug.apply(t.default,arguments)}function s(e){return e()}function d(){return t.default.warn.apply(t.default,arguments)}function l(){return t.default.debugSeal.apply(t.default,arguments)}function u(e,r){return e.__isMixin?e.__mixin.detect(r.PrototypeMixin):(t.default.MODEL_FACTORY_INJECTIONS&&(e=e.superclass),e.detect(r))}function c(e,t,i){var a=i.modelName,n=e.modelName,o=t.key,s=t.type;r("You cannot add a record of modelClass '"+a+"' to the '"+n+"."+o+"' relationship (only '"+s+"' allowed)",u(e.store.modelFor(s),i.modelClass))}e.__esModule=!0,e.assert=r,e.debug=i,e.deprecate=a,e.info=n,e.runInDebug=o,e.instrument=s,e.warn=d,e.debugSeal=l,e.assertPolymorphicType=c}),t("ember-data/-private/ext/date",["exports","ember","ember-data/-private/debug"],function(e,t,r){e.__esModule=!0,e.parseDate=void 0,t.default.Date=t.default.Date||{};var i=Date.parse,a=[1,4,5,6,7,10,11],n=e.parseDate=function(e){var t=void 0,r=void 0,n=0;if(r=/^(\d{4}|[+\-]\d{6})(?:-(\d{2})(?:-(\d{2}))?)?(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{3}))?)?(?:(Z)|([+\-])(\d{2}):?(?:(\d{2}))?)?)?$/.exec(e)){for(var o,s=0;o=a[s];++s)r[o]=+r[o]||0;r[2]=(+r[2]||1)-1,r[3]=+r[3]||1,"Z"!==r[8]&&void 0!==r[9]&&(n=60*r[10]+r[11],"+"===r[9]&&(n=0-n)),t=Date.UTC(r[1],r[2],r[3],r[4],r[5]+n,r[6],r[7])}else t=i?i(e):NaN;return t};t.default.Date.parse=function(e){return n(e)},(!0===t.default.EXTEND_PROTOTYPES||t.default.EXTEND_PROTOTYPES.Date)&&(Date.parse=n)}),t("ember-data/-private/features",["exports","ember"],function(e,t){function r(){var e;return(e=t.default.FEATURES).isEnabled.apply(e,arguments)}e.__esModule=!0,e.default=r}),t("ember-data/-private/global",["exports"],function(e){function t(e){return e&&e.Object===Object?e:void 0}e.__esModule=!0,e.default=t(function(e){return e&&void 0===e.nodeType?e:void 0}("object"==typeof global&&global))||t("object"==typeof self&&self)||t("object"==typeof window&&window)||new Function("return this")()}),t("ember-data/-private/initializers/data-adapter",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){function r(e){e.register("data-adapter:main",t.default)}e.__esModule=!0,e.default=r}),t("ember-data/-private/initializers/store-injections",["exports"],function(e){function t(e){var t=e.inject||e.injection;t.call(e,"controller","store","service:store"),t.call(e,"route","store","service:store"),t.call(e,"data-adapter","store","service:store")}e.__esModule=!0,e.default=t}),t("ember-data/-private/initializers/store",["exports","ember-data/-private/system/store","ember-data/-private/serializers","ember-data/-private/adapters"],function(e,t,r,i){function a(e,t){return e.has?e.has(t):e.hasRegistration(t)}function n(e){var n=e.registerOptionsForType||e.optionsForType;n.call(e,"serializer",{singleton:!1}),n.call(e,"adapter",{singleton:!1}),e.register("serializer:-default",r.JSONSerializer),e.register("serializer:-rest",r.RESTSerializer),e.register("adapter:-rest",i.RESTAdapter),e.register("adapter:-json-api",i.JSONAPIAdapter),e.register("serializer:-json-api",r.JSONAPISerializer),a(e,"service:store")||e.register("service:store",t.default)}e.__esModule=!0,e.default=n}),t("ember-data/-private/initializers/transforms",["exports","ember-data/-private/transforms"],function(e,t){function r(e){e.register("transform:boolean",t.BooleanTransform),e.register("transform:date",t.DateTransform),e.register("transform:number",t.NumberTransform),e.register("transform:string",t.StringTransform)}e.__esModule=!0,e.default=r}),t("ember-data/-private/instance-initializers/initialize-store-service",["exports","ember-data/-private/debug"],function(e,t){function r(e){(e.lookup?e:e.container).lookup("service:store"),a(e.application.constructor.initializers)}function i(e){return-1!==o.indexOf(e)}function a(e){Object.keys(e).map(function(t){return e[t]}).filter(function(e){return!i(e.name)}).forEach(n)}function n(e){i(e.before),i(e.after)}e.__esModule=!0,e.default=r;var o=["data-adapter","injectStore","transforms","store"]}),t("ember-data/-private/serializers",["exports","ember-data/serializers/json-api","ember-data/serializers/json","ember-data/serializers/rest"],function(e,t,r,i){e.__esModule=!0,e.RESTSerializer=e.JSONSerializer=e.JSONAPISerializer=void 0,e.JSONAPISerializer=t.default,e.JSONSerializer=r.default,e.RESTSerializer=i.default}),t("ember-data/-private/system/clone-null",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){var r=new t.default;for(var i in e)r[i]=e[i];return r}e.__esModule=!0,e.default=r}),t("ember-data/-private/system/coerce-id",["exports"],function(e){function t(e){return null===e||void 0===e||""===e?null:e+""}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/debug",["exports","ember-data/-private/system/debug/debug-adapter"],function(e,t){e.__esModule=!0,e.default=t.default}),t("ember-data/-private/system/debug/debug-adapter",["exports","ember","ember-data/model"],function(e,t,r){e.__esModule=!0;var i=t.default.String.capitalize,a=t.default.String.underscore,n=t.default.assert,o=t.default.get;e.default=t.default.DataAdapter.extend({getFilters:function(){return[{name:"isNew",desc:"New"},{name:"isModified",desc:"Modified"},{name:"isClean",desc:"Clean"}]},detect:function(e){return e!==r.default&&r.default.detect(e)},columnsForType:function(e){var t=[{name:"id",desc:"Id"}],r=0,n=this;return o(e,"attributes").forEach(function(e,o){if(r++>n.attributeLimit)return!1;var s=i(a(o).replace("_"," "));t.push({name:o,desc:s})}),t},getRecords:function(e,t){if(arguments.length<2){var r=e._debugContainerKey;if(r){var i=r.match(/model:(.*)/);i&&(t=i[1])}}return n("Cannot find model name. Please upgrade to Ember.js >= 1.13 for Ember Inspector support",!!t),this.get("store").peekAll(t)},getRecordColumnValues:function(e){var t=this,r=0,i={id:o(e,"id")};return e.eachAttribute(function(a){if(r++>t.attributeLimit)return!1;i[a]=o(e,a)}),i},getRecordKeywords:function(e){var r=[],i=t.default.A(["id"]);return e.eachAttribute(function(e){return i.push(e)}),i.forEach(function(t){return r.push(o(e,t))}),r},getRecordFilterValues:function(e){return{isNew:e.get("isNew"),isModified:e.get("hasDirtyAttributes")&&!e.get("isNew"),isClean:!e.get("hasDirtyAttributes")}},getRecordColor:function(e){var t="black";return e.get("isNew")?t="green":e.get("hasDirtyAttributes")&&(t="blue"),t},observeRecord:function(e,r){var i=t.default.A(),a=t.default.A(["id","isNew","hasDirtyAttributes"]);e.eachAttribute(function(e){return a.push(e)});var n=this;return a.forEach(function(a){var o=function(){r(n.wrapRecord(e))};t.default.addObserver(e,a,o),i.push(function(){t.default.removeObserver(e,a,o)})}),function(){i.forEach(function(e){return e()})}}})}),t("ember-data/-private/system/diff-array",["exports"],function(e){function t(e,t){for(var r=e.length,i=t.length,a=Math.min(r,i),n=null,o=0;o<a;o++)if(e[o]!==t[o]){n=o;break}null===n&&i!==r&&(n=a);var s=0,d=0;if(null!==n){for(var l=a-n,u=1;u<=a;u++)if(e[r-u]!==t[i-u]){l=u-1;break}s=i-l-n,d=r-l-n}return{firstChangeIndex:n,addedCount:s,removedCount:d}}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/empty-object",["exports"],function(e){function t(){}e.__esModule=!0,e.default=t;var r=Object.create(null,{constructor:{value:void 0,enumerable:!1,writable:!0}});t.prototype=r}),t("ember-data/-private/system/identity-map",["exports","ember-data/-private/system/internal-model-map"],function(e,t){e.__esModule=!0;var r=function(){function e(){this._map=Object.create(null)}return e.prototype.retrieve=function(e){var r=this._map[e];return r||(r=this._map[e]=new t.default(e)),r},e.prototype.clear=function(){for(var e=this._map,t=Object.keys(e),r=0;r<t.length;r++){e[t[r]].clear()}},e}();e.default=r}),t("ember-data/-private/system/internal-model-map",["exports","ember-data/-private/debug","ember-data/-private/system/model/internal-model"],function(e,t,r){e.__esModule=!0;var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),a=function(){function e(e){this.modelName=e,this._idToModel=Object.create(null),this._models=[],this._metadata=null}return e.prototype.get=function(e){return this._idToModel[e]},e.prototype.has=function(e){return!!this._idToModel[e]},e.prototype.set=function(e,t){this._idToModel[e]=t},e.prototype.add=function(e,t){t&&(this._idToModel[t]=e),this._models.push(e)},e.prototype.remove=function(e,t){t&&delete this._idToModel[t];var r=this._models.indexOf(e);-1!==r&&this._models.splice(r,1)},e.prototype.contains=function(e){return-1!==this._models.indexOf(e)},e.prototype.clear=function(){if(this._models){var e=this._models;this._models=[];for(var t=0;t<e.length;t++){e[t].unloadRecord()}}this._metadata=null},e.prototype.destroy=function(){this._store=null,this._modelClass=null},i(e,[{key:"idToRecord",get:function(){return this._idToModel}},{key:"length",get:function(){return this._models.length}},{key:"models",get:function(){return this._models}},{key:"metadata",get:function(){return this._metadata||(this._metadata=Object.create(null))}},{key:"type",get:function(){throw new Error("InternalModelMap.type is no longer available")}}]),e}();e.default=a}),t("ember-data/-private/system/is-array-like",["exports","ember"],function(e,t){function r(e){if(!e||e.setInterval)return!1;if(Array.isArray(e))return!0;if(t.default.Array.detect(e))return!0;var r=t.default.typeOf(e);return"array"===r||void 0!==e.length&&"object"===r}e.__esModule=!0,e.default=r}),t("ember-data/-private/system/many-array",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/diff-array"],function(e,t,r,i,a,n){e.__esModule=!0;var o=t.default.get,s=t.default.set;e.default=t.default.Object.extend(t.default.MutableArray,t.default.Evented,{init:function(){this._super.apply(this,arguments),this.isLoaded=!1,this.length=0,this.promise=null,this.meta=this.meta||null,this.isPolymorphic=this.isPolymorphic||!1,this.relationship=this.relationship||null,this.currentState=[],this.flushCanonical(!1)},objectAt:function(e){var t=this.currentState[e];if(void 0!==t)return t.getRecord()},flushCanonical:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if((0,a._objectIsAlive)(this)){var t=this.canonicalState,r=this.currentState.filter(function(e){return e.isNew()&&-1===t.indexOf(e)});t=t.concat(r);var i=(0,n.default)(this.currentState,t);null!==i.firstChangeIndex&&(this.arrayContentWillChange(i.firstChangeIndex,i.removedCount,i.addedCount),this.set("length",t.length),this.currentState=t,this.arrayContentDidChange(i.firstChangeIndex,i.removedCount,i.addedCount),e&&i.addedCount>0&&this.relationship.notifyHasManyChanged())}},internalReplace:function(e,t,r){r||(r=[]),this.arrayContentWillChange(e,t,r.length),this.currentState.splice.apply(this.currentState,[e,t].concat(r)),this.set("length",this.currentState.length),this.arrayContentDidChange(e,t,r.length)},internalRemoveRecords:function(e){for(var t=0;t<e.length;t++){var r=this.currentState.indexOf(e[t]);this.internalReplace(r,1)}},internalAddRecords:function(e,t){void 0===t&&(t=this.currentState.length),this.internalReplace(t,0,e)},replace:function(e,t,r){var i=void 0;t>0&&(i=this.currentState.slice(e,e+t),this.get("relationship").removeRecords(i)),r&&this.get("relationship").addRecords(r.map(function(e){return e._internalModel}),e)},loadingRecordsCount:function(e){this._loadingRecordsCount=e},loadedRecord:function(){0===--this._loadingRecordsCount&&(s(this,"isLoaded",!0),this.trigger("didLoad"))},reload:function(){return this.relationship.reload()},save:function(){var e=this,r="DS: ManyArray#save "+o(this,"type"),a=t.default.RSVP.all(this.invoke("save"),r).then(function(){return e},null,"DS: ManyArray#save return ManyArray");return i.PromiseArray.create({promise:a})},createRecord:function(e){var t=o(this,"store"),r=o(this,"type"),i=t.createRecord(r.modelName,e);return this.pushObject(i),i}})}),t("ember-data/-private/system/model",["exports","ember-data/-private/system/model/model","ember-data/attr","ember-data/-private/system/model/states","ember-data/-private/system/model/errors"],function(e,t,r,i,a){e.__esModule=!0,e.Errors=e.attr=e.RootState=void 0,e.RootState=i.default,e.attr=r.default,e.Errors=a.default,e.default=t.default}),t("ember-data/-private/system/model/errors",["exports","ember","ember-data/-private/debug"],function(e,t,r){e.__esModule=!0;var i=t.default.get,a=t.default.set,n=t.default.isEmpty,o=t.default.makeArray,s=t.default.MapWithDefault;e.default=t.default.ArrayProxy.extend(t.default.Evented,{registerHandlers:function(e,t,r){this._registerHandlers(e,t,r)},_registerHandlers:function(e,t,r){this.on("becameInvalid",e,t),this.on("becameValid",e,r)},errorsByAttributeName:t.default.computed(function(){return s.create({defaultValue:function(){return t.default.A()}})}),errorsFor:function(e){return i(this,"errorsByAttributeName").get(e)},messages:t.default.computed.mapBy("content","message"),content:t.default.computed(function(){return t.default.A()}),unknownProperty:function(e){var t=this.errorsFor(e);return n(t)?null:t},isEmpty:t.default.computed.not("length").readOnly(),add:function(e,t){var r=i(this,"isEmpty");this._add(e,t),r&&!i(this,"isEmpty")&&this.trigger("becameInvalid")},_add:function(e,t){t=this._findOrCreateMessages(e,t),this.addObjects(t),i(this,"errorsByAttributeName").get(e).addObjects(t),this.notifyPropertyChange(e)},_findOrCreateMessages:function(e,t){for(var r=this.errorsFor(e),i=o(t),a=new Array(i.length),n=0;n<i.length;n++){var s=i[n],d=r.findBy("message",s);a[n]=d||{attribute:e,message:s}}return a},remove:function(e){i(this,"isEmpty")||(this._remove(e),i(this,"isEmpty")&&this.trigger("becameValid"))},_remove:function(e){if(!i(this,"isEmpty")){var t=this.rejectBy("attribute",e);a(this,"content",t),i(this,"errorsByAttributeName").delete(e),this.notifyPropertyChange(e)}},clear:function(){i(this,"isEmpty")||(this._clear(),this.trigger("becameValid"))},_clear:function(){if(!i(this,"isEmpty")){var e=i(this,"errorsByAttributeName"),r=t.default.A();e.forEach(function(e,t){r.push(t)}),e.clear(),r.forEach(function(e){this.notifyPropertyChange(e)},this),t.default.ArrayProxy.prototype.clear.call(this)}},has:function(e){return!n(this.errorsFor(e))}})}),t("ember-data/-private/system/model/internal-model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/model/states","ember-data/-private/system/relationships/state/create","ember-data/-private/system/snapshot","ember-data/-private/system/empty-object","ember-data/-private/features","ember-data/-private/system/ordered-set","ember-data/-private/utils","ember-data/-private/system/references"],function(e,t,r,i,a,n,o,s,d,l,u){function c(e){return S[e]||(S[e]=e.split("."))}function h(e){return k[e]||(k[e]=c(e)[0])}function p(e){for(var t=0;t<e.length;++t){var r=e[t].record;if(r&&!r.get("isDestroyed")&&!r.get("isDestroying"))return!1}return!0}e.__esModule=!0;var f=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),m=t.default.get,y=t.default.set,v=t.default.copy,b=t.default.Error,_=t.default.inspect,g=t.default.isEmpty,R=t.default.isEqual,A=t.default.setOwner,M=t.default.RSVP,F=t.default.RSVP.Promise,z=t.default.assign||t.default.merge,T=new o.default,k=new o.default,S=new o.default,x=1,E=1,P=function(){function e(e,r,i,a){this.id=r,this[t.default.GUID_KEY]=x+++"internal-model",this.store=i,this.modelName=e,this._loadingPromise=null,this._record=null,this._isDestroyed=!1,this.isError=!1,this._isUpdatingRecordArrays=!1,this._isDematerializing=!1,this.resetRecord(),a&&(this.__data=a),this._modelClass=null,this.__deferredTriggers=null,this.__recordArrays=null,this._references=null,this._recordReference=null,this.__relationships=null,this.__implicitRelationships=null,this._bfsId=0}return e.prototype.isEmpty=function(){return this.currentState.isEmpty},e.prototype.isLoading=function(){return this.currentState.isLoading},e.prototype.isLoaded=function(){return this.currentState.isLoaded},e.prototype.hasDirtyAttributes=function(){return this.currentState.hasDirtyAttributes},e.prototype.isSaving=function(){return this.currentState.isSaving},e.prototype.isDeleted=function(){return this.currentState.isDeleted},e.prototype.isNew=function(){return this.currentState.isNew},e.prototype.isValid=function(){return this.currentState.isValid},e.prototype.dirtyType=function(){return this.currentState.dirtyType},e.prototype.getRecord=function(){if(!this._record&&!this._isDematerializing){var e={store:this.store,_internalModel:this,id:this.id,currentState:this.currentState,isError:this.isError,adapterError:this.error};A?A(e,(0,l.getOwner)(this.store)):e.container=this.store.container,this._record=this.store.modelFactoryFor(this.modelName).create(e),this._triggerDeferredTriggers()}return this._record},e.prototype.resetRecord=function(){this._record=null,this.dataHasInitialized=!1,this.isReloading=!1,this.error=null,this.currentState=i.default.empty,this.__attributes=null,this.__inFlightAttributes=null,this._data=null},e.prototype.dematerializeRecord=function(){this.record&&(this._isDematerializing=!0,this.record.destroy(),this.destroyRelationships(),this.updateRecordArrays(),this.resetRecord())},e.prototype.deleteRecord=function(){this.send("deleteRecord")},e.prototype.save=function(e){var t="DS: Model#save "+this,r=M.defer(t);return this.store.scheduleSave(this,r,e),r.promise},e.prototype.startedReloading=function(){this.isReloading=!0,this.hasRecord&&y(this.record,"isReloading",!0)},e.prototype.finishedReloading=function(){this.isReloading=!1,this.hasRecord&&y(this.record,"isReloading",!1)},e.prototype.reload=function(){this.startedReloading();var e=this,t="DS: Model#reload of "+this;return new F(function(t){e.send("reloadRecord",t)},t).then(function(){return e.didCleanError(),e},function(t){throw e.didError(t),t},"DS: Model#reload complete, update flags").finally(function(){e.finishedReloading(),e.updateRecordArrays()})},e.prototype._directlyRelatedInternalModels=function(){var e=this,t=[];return this.type.eachRelationship(function(r,i){if(e._relationships.has(r)){var a=e._relationships.get(r),n=a.members.toArray(),o=a.canonicalMembers.toArray();t=t.concat(n,o)}}),t},e.prototype._allRelatedInternalModels=function(){var e=[],t=[],r=E++;for(t.push(this),this._bfsId=r;t.length>0;){var i=t.shift();e.push(i);for(var a=i._directlyRelatedInternalModels(),n=0;n<a.length;++n){var o=a[n];o._bfsId<r&&(t.push(o),o._bfsId=r)}}return e},e.prototype.unloadRecord=function(){this.send("unloadRecord"),this.dematerializeRecord(),t.default.run.schedule("destroy",this,"_checkForOrphanedInternalModels")},e.prototype._checkForOrphanedInternalModels=function(){this._isDematerializing=!1,this.isDestroyed||this._cleanupOrphanedInternalModels()},e.prototype._cleanupOrphanedInternalModels=function(){var e=this._allRelatedInternalModels();if(p(e))for(var t=0;t<e.length;++t){var r=e[t];r.isDestroyed||r.destroy()}},e.prototype.eachRelationship=function(e,t){return this.modelClass.eachRelationship(e,t)},e.prototype.destroy=function(){this.store._removeFromIdMap(this),this._isDestroyed=!0},e.prototype.eachAttribute=function(e,t){return this.modelClass.eachAttribute(e,t)},e.prototype.inverseFor=function(e){return this.modelClass.inverseFor(e)},e.prototype.setupData=function(e){var t=void 0;this.hasRecord&&(t=this._changedKeys(e.attributes)),z(this._data,e.attributes),this.pushedData(),this.hasRecord&&this.record._notifyProperties(t),this.didInitializeData()},e.prototype.becameReady=function(){this.store.recordArrayManager.recordWasLoaded(this)},e.prototype.didInitializeData=function(){this.dataHasInitialized||(this.becameReady(),this.dataHasInitialized=!0)},e.prototype.createSnapshot=function(e){return new n.default(this,e)},e.prototype.loadingData=function(e){this.send("loadingData",e)},e.prototype.loadedData=function(){this.send("loadedData"),this.didInitializeData()},e.prototype.notFound=function(){this.send("notFound")},e.prototype.pushedData=function(){this.send("pushedData")},e.prototype.flushChangedAttributes=function(){this._inFlightAttributes=this._attributes,this._attributes=new o.default},e.prototype.hasChangedAttributes=function(){return Object.keys(this._attributes).length>0},e.prototype.updateChangedAttributes=function(){for(var e=this.changedAttributes(),t=Object.keys(e),r=this._attributes,i=0,a=t.length;i<a;i++){var n=t[i],o=e[n];o[0]===o[1]&&delete r[n]}},e.prototype.changedAttributes=function(){for(var e=this._data,t=this._attributes,r=this._inFlightAttributes,i=z(v(r),t),a=new o.default,n=Object.keys(i),s=0,d=n.length;s<d;s++){var l=n[s];a[l]=[e[l],i[l]]}return a},e.prototype.adapterWillCommit=function(){this.send("willCommit")},e.prototype.adapterDidDirty=function(){this.send("becomeDirty"),this.updateRecordArrays()},e.prototype.send=function(e,t){var r=this.currentState;return r[e]||this._unhandledEvent(r,e,t),r[e](this,t)},e.prototype.notifyHasManyAdded=function(e,t,r){this.hasRecord&&this.record.notifyHasManyAdded(e,t,r)},e.prototype.notifyHasManyRemoved=function(e,t,r){this.hasRecord&&this.record.notifyHasManyRemoved(e,t,r)},e.prototype.notifyBelongsToChanged=function(e,t){this.hasRecord&&this.record.notifyBelongsToChanged(e,t)},e.prototype.notifyPropertyChange=function(e){this.hasRecord&&this.record.notifyPropertyChange(e)},e.prototype.rollbackAttributes=function(){var e=Object.keys(this._attributes);this._attributes=new o.default,m(this,"isError")&&(this._inFlightAttributes=new o.default,this.didCleanError()),this.isDeleted()&&this.becameReady(),this.isNew()&&this.clearRelationships(),this.isValid()&&(this._inFlightAttributes=new o.default),this.send("rolledBack"),this.record._notifyProperties(e)},e.prototype.transitionTo=function(e){var t=h(e),r=this.currentState,i=r.stateName+"->"+e;do{r.exit&&r.exit(this),r=r.parentState}while(!r[t]);var a=void 0,n=void 0,o=void 0,s=void 0,d=T[i];if(d)a=d.setups,n=d.enters,r=d.state;else{a=[],n=[];var l=c(e);for(o=0,s=l.length;o<s;o++)r=r[l[o]],r.enter&&n.push(r),r.setup&&a.push(r);T[i]={setups:a,enters:n,state:r}}for(o=0,s=n.length;o<s;o++)n[o].enter(this);for(this.currentState=r,this.hasRecord&&y(this.record,"currentState",r),o=0,s=a.length;o<s;o++)a[o].setup(this);this.updateRecordArrays()},e.prototype._unhandledEvent=function(e,t,r){var i="Attempted to handle event `"+t+"` ";throw i+="on "+String(this)+" while in state ",i+=e.stateName+". ",void 0!==r&&(i+="Called with "+_(r)+"."),new b(i)},e.prototype.triggerLater=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];1===this._deferredTriggers.push(t)&&this.store._updateInternalModel(this)},e.prototype._triggerDeferredTriggers=function(){if(this.hasRecord){for(var e=0,t=this._deferredTriggers.length;e<t;e++)this.record.trigger.apply(this.record,this._deferredTriggers[e]);this._deferredTriggers.length=0}},e.prototype.clearRelationships=function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){var i=e._relationships.get(t);i.clear(),i.destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].clear(),e._implicitRelationships[t].destroy()})},e.prototype.destroyRelationships=function(){var e=this;this.eachRelationship(function(t,r){if(e._relationships.has(t)){e._relationships.get(t).destroy()}}),Object.keys(this._implicitRelationships).forEach(function(t){e._implicitRelationships[t].destroy()})},e.prototype.preloadData=function(e){var t=this;Object.keys(e).forEach(function(r){var i=m(e,r);t.modelClass.metaForProperty(r).isRelationship?t._preloadRelationship(r,i):t._data[r]=i})},e.prototype._preloadRelationship=function(e,t){var r=this.modelClass.metaForProperty(e),i=r.type;"hasMany"===r.kind?this._preloadHasMany(e,t,i):this._preloadBelongsTo(e,t,i)},e.prototype._preloadHasMany=function(e,t,r){for(var i=new Array(t.length),a=0;a<t.length;a++){var n=t[a];i[a]=this._convertStringOrNumberIntoInternalModel(n,r)}this._relationships.get(e).updateRecordsFromAdapter(i)},e.prototype._preloadBelongsTo=function(e,t,r){var i=this._convertStringOrNumberIntoInternalModel(t,r);this._relationships.get(e).setRecord(i)},e.prototype._convertStringOrNumberIntoInternalModel=function(e,t){return"string"==typeof e||"number"==typeof e?this.store._internalModelForId(t,e):e._internalModel?e._internalModel:e},e.prototype.updateRecordArrays=function(){this._isUpdatingRecordArrays||(this._isUpdatingRecordArrays=!0,this.store.recordArrayManager.recordDidChange(this))},e.prototype.setId=function(e){this.id=e,this.record.get("id")!==e&&this.record.set("id",e)},e.prototype.didError=function(e){this.error=e,this.isError=!0,this.hasRecord&&this.record.setProperties({isError:!0,adapterError:e})},e.prototype.didCleanError=function(){this.error=null,this.isError=!1,this.hasRecord&&this.record.setProperties({isError:!1,adapterError:null})},e.prototype.adapterDidCommit=function(e){e&&(e=e.attributes),this.didCleanError();var t=this._changedKeys(e);z(this._data,this._inFlightAttributes),e&&z(this._data,e),this._inFlightAttributes=new o.default,this.send("didCommit"),this.updateRecordArrays(),
|
2
|
+
e&&this.record._notifyProperties(t)},e.prototype.addErrorMessageToAttribute=function(e,t){m(this.getRecord(),"errors")._add(e,t)},e.prototype.removeErrorMessageFromAttribute=function(e){m(this.getRecord(),"errors")._remove(e)},e.prototype.clearErrorMessages=function(){m(this.getRecord(),"errors")._clear()},e.prototype.hasErrors=function(){var e=m(this.getRecord(),"errors");return!g(e)},e.prototype.adapterDidInvalidate=function(e){var t=void 0;for(t in e)e.hasOwnProperty(t)&&this.addErrorMessageToAttribute(t,e[t]);this.send("becameInvalid"),this._saveWasRejected()},e.prototype.adapterDidError=function(e){this.send("becameError"),this.didError(e),this._saveWasRejected()},e.prototype._saveWasRejected=function(){for(var e=Object.keys(this._inFlightAttributes),t=this._attributes,r=0;r<e.length;r++)void 0===t[e[r]]&&(t[e[r]]=this._inFlightAttributes[e[r]]);this._inFlightAttributes=new o.default},e.prototype._changedKeys=function(e){var t=[];if(e){var r=void 0,i=void 0,a=void 0,n=void 0,s=Object.keys(e),d=s.length,l=this._attributes;for(r=z(new o.default,this._data),r=z(r,this._inFlightAttributes),i=0;i<d;i++)n=s[i],a=e[n],void 0===l[n]&&(R(r[n],a)||t.push(n))}return t},e.prototype.toString=function(){return"<"+this.modelName+":"+this.id+">"},e.prototype.referenceFor=function(e,t){var r=this.references[t];if(!r){var i=this._relationships.get(t);"belongsTo"===e?r=new u.BelongsToReference(this.store,this,i):"hasMany"===e&&(r=new u.HasManyReference(this.store,this,i)),this.references[t]=r}return r},f(e,[{key:"modelClass",get:function(){return this._modelClass||(this._modelClass=this.store._modelFor(this.modelName))}},{key:"type",get:function(){return this.modelClass}},{key:"recordReference",get:function(){return null===this._recordReference&&(this._recordReference=new u.RecordReference(this.store,this)),this._recordReference}},{key:"_recordArrays",get:function(){return null===this.__recordArrays&&(this.__recordArrays=d.default.create()),this.__recordArrays}},{key:"references",get:function(){return null===this._references&&(this._references=new o.default),this._references}},{key:"_deferredTriggers",get:function(){return null===this.__deferredTriggers&&(this.__deferredTriggers=[]),this.__deferredTriggers}},{key:"_attributes",get:function(){return null===this.__attributes&&(this.__attributes=new o.default),this.__attributes},set:function(e){this.__attributes=e}},{key:"_relationships",get:function(){return null===this.__relationships&&(this.__relationships=new a.default(this)),this.__relationships}},{key:"_inFlightAttributes",get:function(){return null===this.__inFlightAttributes&&(this.__inFlightAttributes=new o.default),this.__inFlightAttributes},set:function(e){this.__inFlightAttributes=e}},{key:"_data",get:function(){return null===this.__data&&(this.__data=new o.default),this.__data},set:function(e){this.__data=e}},{key:"_implicitRelationships",get:function(){return null===this.__implicitRelationships&&(this.__implicitRelationships=new o.default),this.__implicitRelationships}},{key:"record",get:function(){return this._record}},{key:"isDestroyed",get:function(){return this._isDestroyed}},{key:"hasRecord",get:function(){return!!this._record}}]),e}();e.default=P,(0,s.default)("ds-rollback-attribute")&&(P.prototype.lastAcknowledgedValue=function(e){return e in this._inFlightAttributes?this._inFlightAttributes[e]:this._data[e]})}),t("ember-data/-private/system/model/model",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/model/errors","ember-data/-private/features","ember-data/-private/system/model/states","ember-data/-private/system/empty-object","ember-data/-private/system/relationships/ext"],function(e,t,r,i,a,n,o,s,d){function l(e,t,r,i){var a=i||[],n=u(t,"relationships");if(!n)return a;var o=n.get(e.modelName).filter(function(e){var i=t.metaForProperty(e.name).options;return!i.inverse||r===i.inverse});return o&&a.push.apply(a,o),e.superclass&&l(e.superclass,t,r,a),a}e.__esModule=!0;var u=t.default.get,c=t.default.computed,h=t.default.Map,p=c("currentState",function(e){return u(this._internalModel.currentState,e)}).readOnly(),f=t.default.Object.extend(t.default.Evented,{_internalModel:null,store:null,isEmpty:p,isLoading:p,isLoaded:p,hasDirtyAttributes:c("currentState.isDirty",function(){return this.get("currentState.isDirty")}),isSaving:p,isDeleted:p,isNew:p,isValid:p,dirtyType:p,isError:!1,isReloading:!1,id:null,currentState:o.default.empty,errors:c(function(){var e=a.default.create();return e._registerHandlers(this._internalModel,function(){this.send("becameInvalid")},function(){this.send("becameValid")}),e}).readOnly(),adapterError:null,serialize:function(e){return this._internalModel.createSnapshot().serialize(e)},toJSON:function(e){var t=this.store.serializerFor("-default"),r=this._internalModel.createSnapshot();return t.serialize(r,e)},ready:function(){},didLoad:function(){},didUpdate:function(){},didCreate:function(){},didDelete:function(){},becameInvalid:function(){},becameError:function(){},rolledBack:function(){},send:function(e,t){return this._internalModel.send(e,t)},transitionTo:function(e){return this._internalModel.transitionTo(e)},deleteRecord:function(){this._internalModel.deleteRecord()},destroyRecord:function(e){return this.deleteRecord(),this.save(e)},unloadRecord:function(){this.isDestroyed||this._internalModel.unloadRecord()},_notifyProperties:function(e){t.default.beginPropertyChanges();for(var r=void 0,i=0,a=e.length;i<a;i++)r=e[i],this.notifyPropertyChange(r);t.default.endPropertyChanges()},changedAttributes:function(){return this._internalModel.changedAttributes()},rollbackAttributes:function(){this._internalModel.rollbackAttributes()},_createSnapshot:function(){return this._internalModel.createSnapshot()},toStringExtension:function(){return u(this,"id")},save:function(e){var t=this;return i.PromiseObject.create({promise:this._internalModel.save(e).then(function(){return t})})},reload:function(){var e=this;return i.PromiseObject.create({promise:this._internalModel.reload().then(function(){return e})})},trigger:function(e){for(var r=arguments.length,i=new Array(r-1),a=1;a<r;a++)i[a-1]=arguments[a];t.default.tryInvoke(this,e,i),this._super.apply(this,arguments)},willMergeMixin:function(e){this.constructor},attr:function(){},belongsTo:function(e){return this._internalModel.referenceFor("belongsTo",e)},hasMany:function(e){return this._internalModel.referenceFor("hasMany",e)},setId:t.default.observer("id",function(){this._internalModel.setId(this.get("id"))}),_debugInfo:function(){var e=["id"],t={},r=[];this.eachAttribute(function(t,r){return e.push(t)});var i=[{name:"Attributes",properties:e,expand:!0}];return this.eachRelationship(function(e,a){var n=t[a.kind];void 0===n&&(n=t[a.kind]=[],i.push({name:a.name,properties:n,expand:!0})),n.push(e),r.push(e)}),i.push({name:"Flags",properties:["isLoaded","hasDirtyAttributes","isSaving","isDeleted","isError","isNew","isValid"]}),{propertyInfo:{includeOtherProperties:!0,groups:i,expensiveProperties:r}}},notifyBelongsToChanged:function(e){this.notifyPropertyChange(e)},didDefineProperty:function(e,r,i){if(i instanceof t.default.ComputedProperty){i.meta().parentType=e.constructor}},eachRelationship:function(e,t){this.constructor.eachRelationship(e,t)},relationshipFor:function(e){return u(this.constructor,"relationshipsByName").get(e)},inverseFor:function(e){return this.constructor.inverseFor(e,this.store)},notifyHasManyAdded:function(e){this.notifyPropertyChange(e)},eachAttribute:function(e,t){this.constructor.eachAttribute(e,t)}});Object.defineProperty(f.prototype,"data",{get:function(){return this._internalModel._data}}),f.reopenClass({isModel:!0,modelName:null,typeForRelationship:function(e,t){var r=u(this,"relationshipsByName").get(e);return r&&t.modelFor(r.type)},inverseMap:t.default.computed(function(){return new s.default}),inverseFor:function(e,t){var r=u(this,"inverseMap");if(r[e])return r[e];var i=this._findInverseFor(e,t);return r[e]=i,i},_findInverseFor:function(e,r){var i=this.typeForRelationship(e,r);if(!i)return null;var a=this.metaForProperty(e),n=a.options;if(null===n.inverse)return null;var o=void 0,s=void 0,d=void 0;if(n.inverse)o=n.inverse,d=t.default.get(i,"relationshipsByName").get(o),s=d.kind;else{a.type,a.parentType.modelName;var u=l(this,i,e);if(0===u.length)return null;var c=u.filter(function(t){var r=i.metaForProperty(t.name).options;return e===r.inverse});1===c.length&&(u=c),o=u[0].name,s=u[0].kind}return{type:i,name:o,kind:s}},relationships:d.relationshipsDescriptor,relationshipNames:t.default.computed(function(){var e={hasMany:[],belongsTo:[]};return this.eachComputedProperty(function(t,r){r.isRelationship&&e[r.kind].push(t)}),e}),relatedTypes:d.relatedTypesDescriptor,relationshipsByName:d.relationshipsByNameDescriptor,fields:t.default.computed(function(){var e=h.create();return this.eachComputedProperty(function(t,r){r.isRelationship?e.set(t,r.kind):r.isAttribute&&e.set(t,"attribute")}),e}).readOnly(),eachRelationship:function(e,t){u(this,"relationshipsByName").forEach(function(r,i){e.call(t,i,r)})},eachRelatedType:function(e,t){for(var r=u(this,"relatedTypes"),i=0;i<r.length;i++){var a=r[i];e.call(t,a)}},determineRelationshipType:function(e,t){var r=e.key,i=e.kind,a=this.inverseFor(r,t),n=void 0;return a?(n=a.kind,"belongsTo"===n?"belongsTo"===i?"oneToOne":"manyToOne":"belongsTo"===i?"oneToMany":"manyToMany"):"belongsTo"===i?"oneToNone":"manyToNone"},attributes:t.default.computed(function(){var e=h.create();return this.eachComputedProperty(function(t,r){r.isAttribute&&(r.name=t,e.set(t,r))}),e}).readOnly(),transformedAttributes:t.default.computed(function(){var e=h.create();return this.eachAttribute(function(t,r){r.type&&e.set(t,r.type)}),e}).readOnly(),eachAttribute:function(e,t){u(this,"attributes").forEach(function(r,i){e.call(t,i,r)})},eachTransformedAttribute:function(e,t){u(this,"transformedAttributes").forEach(function(r,i){e.call(t,i,r)})}}),t.default.setOwner&&Object.defineProperty(f.prototype,"container",{configurable:!0,enumerable:!1,get:function(){return this.store.container}}),(0,n.default)("ds-rollback-attribute")&&f.reopen({rollbackAttribute:function(e){e in this._internalModel._attributes&&this.set(e,this._internalModel.lastAcknowledgedValue(e))}}),e.default=f}),t("ember-data/-private/system/model/states",["exports","ember-data/-private/debug"],function(e,t){function r(e,t){t.value===t.originalValue?(delete e._attributes[t.name],e.send("propertyWasReset",t.name)):t.value!==t.oldValue&&e.send("becomeDirty"),e.updateRecordArrays()}function i(e){var t={},r=void 0;for(var a in e)r=e[a],t[a]=r&&"object"==typeof r?i(r):r;return t}function a(e,t){for(var r in t)e[r]=t[r];return e}function n(e){return a(i(l),e)}function o(e){e.transitionTo("deleted.saved"),e.send("invokeLifecycleCallbacks")}function s(e){}function d(e,t,r){e=a(t?Object.create(t):{},e),e.parentState=t,e.stateName=r;for(var i in e)e.hasOwnProperty(i)&&"parentState"!==i&&"stateName"!==i&&"object"==typeof e[i]&&(e[i]=d(e[i],e,r+"."+i));return e}e.__esModule=!0;var l={initialState:"uncommitted",isDirty:!0,uncommitted:{didSetProperty:r,loadingData:function(){},propertyWasReset:function(e,t){e.hasChangedAttributes()||e.send("rolledBack")},pushedData:function(e){e.updateChangedAttributes(),e.hasChangedAttributes()||e.transitionTo("loaded.saved")},becomeDirty:function(){},willCommit:function(e){e.transitionTo("inFlight")},reloadRecord:function(e,t){t(e.store._reloadRecord(e))},rolledBack:function(e){e.transitionTo("loaded.saved")},becameInvalid:function(e){e.transitionTo("invalid")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")}},inFlight:{isSaving:!0,didSetProperty:r,becomeDirty:function(){},pushedData:function(){},unloadRecord:s,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks",this.dirtyType)},becameInvalid:function(e){e.transitionTo("invalid"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)}},invalid:{isValid:!1,deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),r(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},pushedData:function(){},willCommit:function(e){e.clearErrorMessages(),e.transitionTo("inFlight")},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")},invokeLifecycleCallbacks:function(e){e.triggerLater("becameInvalid",e)}}},u=n({dirtyType:"created",isNew:!0});u.invalid.rolledBack=function(e){e.transitionTo("deleted.saved")},u.uncommitted.rolledBack=function(e){e.transitionTo("deleted.saved")};var c=n({dirtyType:"updated"});u.uncommitted.deleteRecord=o,u.invalid.deleteRecord=o,u.uncommitted.rollback=function(e){l.uncommitted.rollback.apply(this,arguments),e.transitionTo("deleted.saved")},u.uncommitted.pushedData=function(e){e.transitionTo("loaded.updated.uncommitted"),e.triggerLater("didLoad")},u.uncommitted.propertyWasReset=function(){},c.inFlight.unloadRecord=s,c.uncommitted.deleteRecord=function(e){e.transitionTo("deleted.uncommitted")};var h={isEmpty:!1,isLoading:!1,isLoaded:!1,isDirty:!1,isSaving:!1,isDeleted:!1,isNew:!1,isValid:!0,rolledBack:function(){},unloadRecord:function(e){},propertyWasReset:function(){},empty:{isEmpty:!0,loadingData:function(e,t){e._loadingPromise=t,e.transitionTo("loading")},loadedData:function(e){e.transitionTo("loaded.created.uncommitted"),e.triggerLater("ready")},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready")}},loading:{isLoading:!0,exit:function(e){e._loadingPromise=null},pushedData:function(e){e.transitionTo("loaded.saved"),e.triggerLater("didLoad"),e.triggerLater("ready"),e.didCleanError()},becameError:function(e){e.triggerLater("becameError",e)},notFound:function(e){e.transitionTo("empty")}},loaded:{initialState:"saved",isLoaded:!0,loadingData:function(){},saved:{setup:function(e){e.hasChangedAttributes()&&e.adapterDidDirty()},didSetProperty:r,pushedData:function(){},becomeDirty:function(e){e.transitionTo("updated.uncommitted")},willCommit:function(e){e.transitionTo("updated.inFlight")},reloadRecord:function(e,t){t(e.store._reloadRecord(e))},deleteRecord:function(e){e.transitionTo("deleted.uncommitted")},unloadRecord:function(e){},didCommit:function(){},notFound:function(){}},created:u,updated:c},deleted:{initialState:"uncommitted",dirtyType:"deleted",isDeleted:!0,isLoaded:!0,isDirty:!0,setup:function(e){e.updateRecordArrays()},uncommitted:{willCommit:function(e){e.transitionTo("inFlight")},rollback:function(e){e.rollbackAttributes(),e.triggerLater("ready")},pushedData:function(){},becomeDirty:function(){},deleteRecord:function(){},rolledBack:function(e){e.transitionTo("loaded.saved"),e.triggerLater("ready")}},inFlight:{isSaving:!0,unloadRecord:s,willCommit:function(){},didCommit:function(e){e.transitionTo("saved"),e.send("invokeLifecycleCallbacks")},becameError:function(e){e.transitionTo("uncommitted"),e.triggerLater("becameError",e)},becameInvalid:function(e){e.transitionTo("invalid"),e.triggerLater("becameInvalid",e)}},saved:{isDirty:!1,setup:function(e){e.clearRelationships()},invokeLifecycleCallbacks:function(e){e.triggerLater("didDelete",e),e.triggerLater("didCommit",e)},willCommit:function(){},didCommit:function(){}},invalid:{isValid:!1,didSetProperty:function(e,t){e.removeErrorMessageFromAttribute(t.name),r(e,t),e.hasErrors()||this.becameValid(e)},becameInvalid:function(){},becomeDirty:function(){},deleteRecord:function(){},willCommit:function(){},rolledBack:function(e){e.clearErrorMessages(),e.transitionTo("loaded.saved"),e.triggerLater("ready")},becameValid:function(e){e.transitionTo("uncommitted")}}},invokeLifecycleCallbacks:function(e,t){"created"===t?e.triggerLater("didCreate",e):e.triggerLater("didUpdate",e),e.triggerLater("didCommit",e)}};e.default=d(h,null,"root")}),t("ember-data/-private/system/normalize-link",["exports"],function(e){function t(e){switch(typeof e){case"object":return e;case"string":return{href:e}}return null}e.__esModule=!0,e.default=t}),t("ember-data/-private/system/normalize-model-name",["exports","ember"],function(e,t){function r(e){return t.default.String.dasherize(e)}e.__esModule=!0,e.default=r}),t("ember-data/-private/system/ordered-set",["exports","ember"],function(e,t){function r(){this._super$constructor()}e.__esModule=!0,e.default=r;var i=t.default.OrderedSet,a=t.default.guidFor;r.create=function(){return new this},r.prototype=Object.create(i.prototype),r.prototype.constructor=r,r.prototype._super$constructor=i,r.prototype.addWithIndex=function(e,t){var r=a(e),i=this.presenceSet,n=this.list;if(!0!==i[r])return i[r]=!0,void 0===t||null===t?n.push(e):n.splice(t,0,e),this.size+=1,this}}),t("ember-data/-private/system/promise-proxies",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t){return u.create({promise:d.resolve(e,t)})}function a(e,t){return l.create({promise:d.resolve(e,t)})}function n(e){return function(){var t;return(t=s(this,"content"))[e].apply(t,arguments)}}function o(e,t){return c.create({promise:d.resolve(e,t)})}e.__esModule=!0,e.PromiseManyArray=e.PromiseObject=e.PromiseArray=void 0,e.promiseObject=i,e.promiseArray=a,e.proxyToContent=n,e.promiseManyArray=o;var s=t.default.get,d=t.default.RSVP.Promise,l=e.PromiseArray=t.default.ArrayProxy.extend(t.default.PromiseProxyMixin),u=e.PromiseObject=t.default.ObjectProxy.extend(t.default.PromiseProxyMixin),c=e.PromiseManyArray=l.extend({reload:function(){return this.set("promise",this.get("content").reload()),this},createRecord:n("createRecord"),on:n("on"),one:n("one"),trigger:n("trigger"),off:n("off"),has:n("has")})}),t("ember-data/-private/system/record-array-manager",["exports","ember","ember-data/-private/system/record-arrays","ember-data/-private/debug"],function(e,t,r,i){function a(e){e.destroy()}function n(e){for(var t=e.length,r=[],i=0;i<t;i++)r=r.concat(e[i]);return r}function o(e,t){var r=e.indexOf(t);return-1!==r&&(e.splice(r,1),!0)}e.__esModule=!0;var s=t.default.get,d=t.default.MapWithDefault,l=t.default.run,u=function(){function e(e){var t=this;this.store=e.store,this.isDestroying=!1,this.isDestroyed=!1,this.filteredRecordArrays=d.create({defaultValue:function(){return[]}}),this.liveRecordArrays=d.create({defaultValue:function(e){return t.createRecordArray(e)}}),this.changedRecords=[],this.loadedRecords=[],this._adapterPopulatedRecordArrays=[]}return e.prototype.recordDidChange=function(e){1===this.changedRecords.push(e)&&l.schedule("actions",this,this.updateRecordArrays)},e.prototype.recordArraysForRecord=function(e){return e._recordArrays},e.prototype.updateRecordArrays=function(){for(var e=this.changedRecords,t=0,r=e.length;t<r;t++){var i=e[t];i._isDematerializing||i.isDestroyed||"root.deleted.saved"===i.currentState.stateName?this._recordWasDeleted(i):this._recordWasChanged(i),i._isUpdatingRecordArrays=!1}e.length=0},e.prototype._recordWasDeleted=function(e){var t=e.__recordArrays;t&&(t.forEach(function(t){return t._removeInternalModels([e])}),e.__recordArrays=null)},e.prototype._recordWasChanged=function(e){var t=this,r=e.modelName,i=this.filteredRecordArrays.get(r),a=void 0;i.forEach(function(i){a=s(i,"filterFunction"),t.updateFilterRecordArray(i,a,r,e)})},e.prototype.recordWasLoaded=function(e){1===this.loadedRecords.push(e)&&l.schedule("actions",this,this._flushLoadedRecords)},e.prototype._flushLoadedRecords=function(){for(var e=this.loadedRecords,t=0,r=e.length;t<r;t++){for(var i=e[t],a=i.modelName,n=this.filteredRecordArrays.get(a),o=void 0,d=0,l=n.length;d<l;d++){var u=n[d];o=s(u,"filterFunction"),this.updateFilterRecordArray(u,o,a,i)}if(this.liveRecordArrays.has(a)){var c=this.liveRecordArrays.get(a);this._addInternalModelToRecordArray(c,i)}}this.loadedRecords.length=0},e.prototype.updateFilterRecordArray=function(e,t,r,i){var a=t(i.getRecord()),n=this.recordArraysForRecord(i);a?this._addInternalModelToRecordArray(e,i):(n.delete(e),e._removeInternalModels([i]))},e.prototype._addInternalModelToRecordArray=function(e,t){var r=this.recordArraysForRecord(t);r.has(e)||(e._pushInternalModels([t]),r.add(e))},e.prototype.syncLiveRecordArray=function(e,t){var r=0===this.changedRecords.length,i=this.store._internalModelsFor(t),a=i.length===e.length;r&&a||this.populateLiveRecordArray(e,t)},e.prototype.populateLiveRecordArray=function(e,t){for(var r=this.store._internalModelsFor(t),i=r.models,a=0;a<i.length;a++){var n=i[a];n.isDeleted()||n.isEmpty()||this._addInternalModelToRecordArray(e,n)}},e.prototype.updateFilter=function(e,t,r){for(var i=this.store._internalModelsFor(t),a=i.models,n=0;n<a.length;n++){var o=a[n];o.isDeleted()||o.isEmpty()||this.updateFilterRecordArray(e,r,t,o)}},e.prototype.liveRecordArrayFor=function(e){return this.liveRecordArrays.get(e)},e.prototype.createRecordArray=function(e){return r.RecordArray.create({modelName:e,content:t.default.A(),store:this.store,isLoaded:!0,manager:this})},e.prototype.createFilteredRecordArray=function(e,i,a){var n=r.FilteredRecordArray.create({query:a,modelName:e,content:t.default.A(),store:this.store,manager:this,filterFunction:i});return this.registerFilteredRecordArray(n,e,i),n},e.prototype.createAdapterPopulatedRecordArray=function(e,i){var a=r.AdapterPopulatedRecordArray.create({modelName:e,query:i,content:t.default.A(),store:this.store,manager:this});return this._adapterPopulatedRecordArrays.push(a),a},e.prototype.registerFilteredRecordArray=function(e,t,r){this.filteredRecordArrays.get(t).push(e),this.updateFilter(e,t,r)},e.prototype.unregisterRecordArray=function(e){var t=e.modelName,r=this.filteredRecordArrays.get(t),i=o(r,e),a=o(this._adapterPopulatedRecordArrays,e);if(!i&&!a&&this.liveRecordArrays.has(t)){e===this.liveRecordArrayFor(t)&&this.liveRecordArrays.delete(t)}},e.prototype.willDestroy=function(){this.filteredRecordArrays.forEach(function(e){return n(e).forEach(a)}),this.liveRecordArrays.forEach(a),this._adapterPopulatedRecordArrays.forEach(a),this.isDestroyed=!0},e.prototype.destroy=function(){this.isDestroying=!0,t.default.run.schedule("actions",this,this.willDestroy)},e}();e.default=u}),t("ember-data/-private/system/record-arrays",["exports","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/record-arrays/filtered-record-array","ember-data/-private/system/record-arrays/adapter-populated-record-array"],function(e,t,r,i){e.__esModule=!0,e.AdapterPopulatedRecordArray=e.FilteredRecordArray=e.RecordArray=void 0,e.RecordArray=t.default,e.FilteredRecordArray=r.default,e.AdapterPopulatedRecordArray=i.default}),t("ember-data/-private/system/record-arrays/adapter-populated-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array","ember-data/-private/system/clone-null"],function(e,t,r,i){e.__esModule=!0;var a=t.default.get;e.default=r.default.extend({init:function(){this.set("content",this.get("content")||t.default.A()),this._super.apply(this,arguments),this.query=this.query||null,this.links=null},replace:function(){throw new Error("The result of a server query (on "+this.modelName+") is immutable.")},_update:function(){var e=a(this,"store"),t=a(this,"query");return e._query(this.modelName,t,this)},_setInternalModels:function(e,r){this.get("content").setObjects(e),this.setProperties({isLoaded:!0,isUpdating:!1,meta:(0,i.default)(r.meta),links:(0,i.default)(r.links)});for(var a=0,n=e.length;a<n;a++){var o=e[a];this.manager.recordArraysForRecord(o).add(this)}t.default.run.once(this,"trigger","didLoad")}})}),t("ember-data/-private/system/record-arrays/filtered-record-array",["exports","ember","ember-data/-private/system/record-arrays/record-array"],function(e,t,r){e.__esModule=!0;var i=t.default.get;e.default=r.default.extend({init:function(){this._super.apply(this,arguments),this.set("filterFunction",this.get("filterFunction")||null),this.isLoaded=!0},replace:function(){throw new Error("The result of a client-side filter (on "+this.modelName+") is immutable.")},_updateFilter:function(){i(this,"isDestroying")||i(this,"isDestroyed")||i(this,"manager").updateFilter(this,this.modelName,i(this,"filterFunction"))},updateFilter:t.default.observer("filterFunction",function(){t.default.run.once(this,this._updateFilter)})})}),t("ember-data/-private/system/record-arrays/record-array",["exports","ember","ember-data/-private/system/promise-proxies","ember-data/-private/system/snapshot-record-array"],function(e,t,r,i){e.__esModule=!0;var a=t.default.computed,n=t.default.get,o=t.default.set,s=t.default.RSVP.Promise;e.default=t.default.ArrayProxy.extend(t.default.Evented,{init:function(){this._super.apply(this,arguments),this.set("content",this.content||null),this.isLoaded=this.isLoaded||!1,this.isUpdating=!1,this.store=this.store||null,this._updatingPromise=null},replace:function(){throw new Error("The result of a server query (for all "+this.modelName+" types) is immutable. To modify contents, use toArray()")},type:a("modelName",function(){return this.modelName?this.store._modelFor(this.modelName):null}).readOnly(),objectAtContent:function(e){var t=n(this,"content").objectAt(e);return t&&t.getRecord()},update:function(){var e=this;if(n(this,"isUpdating"))return this._updatingPromise;this.set("isUpdating",!0);var t=this._update().finally(function(){e._updatingPromise=null,e.get("isDestroying")||e.get("isDestroyed")||e.set("isUpdating",!1)});return this._updatingPromise=t,t},_update:function(){return this.store.findAll(this.modelName,{reload:!0})},_pushInternalModels:function(e){n(this,"content").pushObjects(e)},_removeInternalModels:function(e){n(this,"content").removeObjects(e)},save:function(){var e=this,t="DS: RecordArray#save "+this.modelName,i=s.all(this.invoke("save"),t).then(function(){return e},null,"DS: RecordArray#save return RecordArray");return r.PromiseArray.create({promise:i})},_dissociateFromOwnRecords:function(){var e=this;this.get("content").forEach(function(t){var r=t.__recordArrays;r&&r.delete(e)})},_unregisterFromManager:function(){this.manager.unregisterRecordArray(this)},willDestroy:function(){this._unregisterFromManager(),this._dissociateFromOwnRecords(),o(this,"content",null),o(this,"length",0),this._super.apply(this,arguments)},_createSnapshot:function(e){return new i.default(this,this.get("meta"),e)},_takeSnapshot:function(){return n(this,"content").map(function(e){return e.createSnapshot()})}})}),t("ember-data/-private/system/references",["exports","ember-data/-private/system/references/record","ember-data/-private/system/references/belongs-to","ember-data/-private/system/references/has-many"],function(e,t,r,i){e.__esModule=!0,e.HasManyReference=e.BelongsToReference=e.RecordReference=void 0,e.RecordReference=t.default,e.BelongsToReference=r.default,e.HasManyReference=i.default}),t("ember-data/-private/system/references/belongs-to",["exports","ember-data/model","ember","ember-data/-private/system/references/reference","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a,n){e.__esModule=!0;var o=function(e,t,r){this._super$constructor(e,t),this.belongsToRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};o.prototype=Object.create(i.default.prototype),o.prototype.constructor=o,o.prototype._super$constructor=i.default,o.prototype.remoteType=function(){return this.belongsToRelationship.link?"link":"id"},o.prototype.id=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.id},o.prototype.link=function(){return this.belongsToRelationship.link},o.prototype.meta=function(){return this.belongsToRelationship.meta},o.prototype.push=function(e){var i=this;return r.default.RSVP.resolve(e).then(function(e){var r=void 0;return e instanceof t.default?((0,a.default)("ds-overhaul-references"),r=e):r=i.store.push(e),i.belongsToRelationship.setCanonicalRecord(r._internalModel),r})},o.prototype.value=function(){var e=this.belongsToRelationship.inverseRecord;return e&&e.isLoaded()?e.getRecord():null},o.prototype.load=function(){var e=this;return"id"===this.remoteType()?this.belongsToRelationship.getRecord():"link"===this.remoteType()?this.belongsToRelationship.findLink().then(function(t){return e.value()}):void 0},o.prototype.reload=function(){var e=this;return this.belongsToRelationship.reload().then(function(t){return e.value()})},e.default=o}),t("ember-data/-private/system/references/has-many",["exports","ember","ember-data/-private/system/references/reference","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i,a){e.__esModule=!0;var n=t.default.RSVP.resolve,o=t.default.get,s=function(e,t,r){this._super$constructor(e,t),this.hasManyRelationship=r,this.type=r.relationshipMeta.type,this.parent=t.recordReference};s.prototype=Object.create(r.default.prototype),s.prototype.constructor=s,s.prototype._super$constructor=r.default,s.prototype.remoteType=function(){return this.hasManyRelationship.link?"link":"ids"},s.prototype.link=function(){return this.hasManyRelationship.link},s.prototype.ids=function(){return this.hasManyRelationship.members.toArray().map(function(e){return e.id})},s.prototype.meta=function(){return this.hasManyRelationship.meta},s.prototype.push=function(e){var r=this;return n(e).then(function(e){var i=e;(0,a.default)("ds-overhaul-references");var n=!0;"object"==typeof e&&e.data&&(i=e.data,n=i.length&&i[0].data,(0,a.default)("ds-overhaul-references")),(0,a.default)("ds-overhaul-references")||(n=!0);var o=void 0;if(n)o=i.map(function(e){return r.store.push(e)._internalModel});else{var s=r.store.push(e);o=t.default.A(s).mapBy("_internalModel")}return r.hasManyRelationship.computeChanges(o),r.hasManyRelationship.manyArray})},s.prototype._isLoaded=function(){return!!o(this.hasManyRelationship,"hasData")&&this.hasManyRelationship.members.toArray().every(function(e){return!0===e.isLoaded()})},s.prototype.value=function(){return this._isLoaded()?this.hasManyRelationship.manyArray:null},s.prototype.load=function(){return this._isLoaded()?n(this.hasManyRelationship.manyArray):this.hasManyRelationship.getRecords()},s.prototype.reload=function(){return this.hasManyRelationship.reload()},e.default=s}),t("ember-data/-private/system/references/record",["exports","ember","ember-data/-private/system/references/reference"],function(e,t,r){e.__esModule=!0;var i=function(e,t){this._super$constructor(e,t),this.type=t.modelName,this._id=t.id};i.prototype=Object.create(r.default.prototype),i.prototype.constructor=i,i.prototype._super$constructor=r.default,i.prototype.id=function(){return this._id},i.prototype.remoteType=function(){return"identity"},i.prototype.push=function(e){var r=this;return t.default.RSVP.resolve(e).then(function(e){return r.store.push(e)})},i.prototype.value=function(){return this.internalModel.record},i.prototype.load=function(){return this.store.findRecord(this.type,this._id)},i.prototype.reload=function(){var e=this.value();return e?e.reload():this.load()},e.default=i}),t("ember-data/-private/system/references/reference",["exports"],function(e){e.__esModule=!0;var t=function(e,t){this.store=e,this.internalModel=t};t.prototype={constructor:t},e.default=t}),t("ember-data/-private/system/relationship-meta",["exports","ember-inflector","ember-data/-private/system/normalize-model-name"],function(e,t,r){function i(e){var i=void 0;return i=e.type||e.key,"hasMany"===e.kind&&(i=(0,t.singularize)((0,r.default)(i))),i}function a(e){return{key:e.key,kind:e.kind,type:i(e),options:e.options,name:e.name,parentType:e.parentType,isRelationship:!0}}e.__esModule=!0,e.typeForRelationshipMeta=i,e.relationshipFromMeta=a}),t("ember-data/-private/system/relationships/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name"],function(e,t,r,i){function a(e,r){var a=void 0,n=void 0
|
3
|
+
;"object"==typeof e?(a=e,n=void 0):(a=r,n=e),"string"==typeof n&&(n=(0,i.default)(n)),a=a||{};var o={type:n,isRelationship:!0,options:a,kind:"belongsTo",name:"Belongs To",key:null};return t.default.computed({get:function(e){return a.hasOwnProperty("serialize"),a.hasOwnProperty("embedded"),this._internalModel._relationships.get(e).getRecord()},set:function(e,t){return void 0===t&&(t=null),t&&t.then?this._internalModel._relationships.get(e).setRecordPromise(t):t?this._internalModel._relationships.get(e).setRecord(t._internalModel):this._internalModel._relationships.get(e).setRecord(t),this._internalModel._relationships.get(e).getRecord()}}).meta(o)}e.__esModule=!0,e.default=a}),t("ember-data/-private/system/relationships/ext",["exports","ember","ember-data/-private/debug","ember-data/-private/system/relationship-meta"],function(e,t,r,i){e.__esModule=!0,e.relationshipsByNameDescriptor=e.relatedTypesDescriptor=e.relationshipsDescriptor=void 0;var a=t.default.Map,n=t.default.MapWithDefault,o=e.relationshipsDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===o._cacheable&&(o._cacheable=!1);var e=new n({defaultValue:function(){return[]}});return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;e.get((0,i.typeForRelationshipMeta)(r)).push({name:t,kind:r.kind})}}),e}).readOnly(),s=e.relatedTypesDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===s._cacheable&&(s._cacheable=!1);var e=void 0,r=t.default.A();return this.eachComputedProperty(function(t,a){a.isRelationship&&(a.key=t,e=(0,i.typeForRelationshipMeta)(a),r.includes(e)||r.push(e))}),r}).readOnly(),d=e.relationshipsByNameDescriptor=t.default.computed(function(){!0===t.default.testing&&!0===d._cacheable&&(d._cacheable=!1);var e=a.create();return this.eachComputedProperty(function(t,r){if(r.isRelationship){r.key=t;var a=(0,i.relationshipFromMeta)(r);a.type=(0,i.typeForRelationshipMeta)(r),e.set(t,a)}}),e}).readOnly()}),t("ember-data/-private/system/relationships/has-many",["exports","ember","ember-data/-private/debug","ember-data/-private/system/normalize-model-name","ember-data/-private/system/is-array-like"],function(e,t,r,i,a){function n(e,r){"object"==typeof e&&(r=e,e=void 0),r=r||{},"string"==typeof e&&(e=(0,i.default)(e));var a={type:e,options:r,isRelationship:!0,kind:"hasMany",name:"Has Many",key:null};return t.default.computed({get:function(e){return this._internalModel._relationships.get(e).getRecords()},set:function(e,t){var r=this._internalModel._relationships.get(e);return r.clear(),r.addRecords(t.map(function(e){return o(e,"_internalModel")})),r.getRecords()}}).meta(a)}e.__esModule=!0,e.default=n;var o=t.default.get}),t("ember-data/-private/system/relationships/state/belongs-to",["exports","ember","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship"],function(e,t,r,i,a){function n(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.__esModule=!0;var s=function(e){function r(t,r,i,a){var o=n(this,e.call(this,t,r,i,a));return o.internalModel=r,o.key=a.key,o.inverseRecord=null,o.canonicalState=null,o}return o(r,e),r.prototype.setRecord=function(e){e?this.addRecord(e):this.inverseRecord&&this.removeRecord(this.inverseRecord),this.setHasData(!0),this.setHasLoaded(!0)},r.prototype.setCanonicalRecord=function(e){e?this.addCanonicalRecord(e):this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.flushCanonicalLater()},r.prototype.addCanonicalRecord=function(t){this.canonicalMembers.has(t)||(this.canonicalState&&this.removeCanonicalRecord(this.canonicalState),this.canonicalState=t,e.prototype.addCanonicalRecord.call(this,t))},r.prototype.inverseDidDematerialize=function(){this.notifyBelongsToChanged()},r.prototype.flushCanonical=function(){this.inverseRecord&&this.inverseRecord.isNew()&&!this.canonicalState||(this.inverseRecord!==this.canonicalState&&(this.inverseRecord=this.canonicalState,this.notifyBelongsToChanged()),e.prototype.flushCanonical.call(this))},r.prototype.addRecord=function(t){this.members.has(t)||(this.inverseRecord&&this.removeRecord(this.inverseRecord),this.inverseRecord=t,e.prototype.addRecord.call(this,t),this.notifyBelongsToChanged())},r.prototype.setRecordPromise=function(e){var t=e.get&&e.get("content");this.setRecord(t?t._internalModel:t)},r.prototype.removeRecordFromOwn=function(t){this.members.has(t)&&(this.inverseRecord=null,e.prototype.removeRecordFromOwn.call(this,t),this.notifyBelongsToChanged())},r.prototype.notifyBelongsToChanged=function(){this.internalModel.notifyBelongsToChanged(this.key)},r.prototype.removeCanonicalRecordFromOwn=function(t){this.canonicalMembers.has(t)&&(this.canonicalState=null,e.prototype.removeCanonicalRecordFromOwn.call(this,t))},r.prototype.findRecord=function(){return this.inverseRecord?this.store._findByInternalModel(this.inverseRecord):t.default.RSVP.Promise.resolve(null)},r.prototype.fetchLink=function(){var e=this;return this.store.findBelongsTo(this.internalModel,this.link,this.relationshipMeta).then(function(t){return t&&e.addRecord(t),t})},r.prototype.getRecord=function(){var e=this;if(this.isAsync){var t=void 0;return t=this.link?this.hasLoaded?this.findRecord():this.findLink().then(function(){return e.findRecord()}):this.findRecord(),i.PromiseObject.create({promise:t,content:this.inverseRecord?this.inverseRecord.getRecord():null})}return null===this.inverseRecord?null:this.inverseRecord.getRecord()},r.prototype.reload=function(){return this.link?this.fetchLink():this.inverseRecord&&this.inverseRecord.hasRecord?this.inverseRecord.record.reload():this.findRecord()},r.prototype.updateData=function(e){var t=this.store._pushResourceIdentifier(this,e);this.setCanonicalRecord(t)},r}(a.default);e.default=s}),t("ember-data/-private/system/relationships/state/create",["exports","ember","ember-data/-private/system/relationships/state/has-many","ember-data/-private/system/relationships/state/belongs-to","ember-data/-private/system/empty-object","ember-data/-private/debug"],function(e,t,r,i,a,n){function o(e){var t=e.options;return!(t&&null===t.inverse)}function s(e,t,a){var n=void 0,s=null;return o(t)&&(s=e.type.inverseFor(t.key,a)),s&&(n=s.name),"hasMany"===t.kind?new r.default(a,e,n,t):new i.default(a,e,n,t)}e.__esModule=!0;var d=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),l=t.default.get,u=function(){function e(e){this.internalModel=e,this.initializedRelationships=new a.default}return e.prototype.has=function(e){return!!this.initializedRelationships[e]},e.prototype.get=function(e){var t=this.initializedRelationships,r=t[e];if(!r){var i=this.internalModel,a=l(i.type,"relationshipsByName"),n=a.get(e);n&&(r=t[e]=s(i,n,i.store))}return r},d(e,[{key:"record",get:function(){return this.internalModel}}]),e}();e.default=u}),t("ember-data/-private/system/relationships/state/has-many",["exports","ember-data/-private/debug","ember-data/-private/system/promise-proxies","ember-data/-private/system/relationships/state/relationship","ember-data/-private/system/ordered-set","ember-data/-private/system/many-array"],function(e,t,r,i,a,n){function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function d(e){var t=new a.default;if(e)for(var r=0,i=e.length;r<i;r++)t.add(e[r]);return t}e.__esModule=!0;var l=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),u=function(e){function t(t,r,i,a){var n=o(this,e.call(this,t,r,i,a));return n.belongsToType=a.type,n.canonicalState=[],n.isPolymorphic=a.options.polymorphic,n._manyArray=null,n.__loadingPromise=null,n}return s(t,e),t.prototype._updateLoadingPromise=function(e,t){return this.__loadingPromise?(t&&this.__loadingPromise.set("content",t),this.__loadingPromise.set("promise",e)):this.__loadingPromise=new r.PromiseManyArray({promise:e,content:t}),this.__loadingPromise},t.prototype.destroy=function(){e.prototype.destroy.call(this),this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this._loadingPromise&&this._loadingPromise.destroy()},t.prototype.updateMeta=function(t){e.prototype.updateMeta.call(this,t),this._manyArray&&this._manyArray.set("meta",t)},t.prototype.addCanonicalRecord=function(t,r){this.canonicalMembers.has(t)||(void 0!==r?this.canonicalState.splice(r,0,t):this.canonicalState.push(t),e.prototype.addCanonicalRecord.call(this,t,r))},t.prototype.inverseDidDematerialize=function(){this._manyArray&&(this._manyArray.destroy(),this._manyArray=null),this.notifyHasManyChanged()},t.prototype.addRecord=function(t,r){this.members.has(t)||(e.prototype.addRecord.call(this,t,r),this.manyArray.internalAddRecords([t],r))},t.prototype.removeCanonicalRecordFromOwn=function(t,r){var i=r;this.canonicalMembers.has(t)&&(void 0===i&&(i=this.canonicalState.indexOf(t)),i>-1&&this.canonicalState.splice(i,1),e.prototype.removeCanonicalRecordFromOwn.call(this,t,r))},t.prototype.flushCanonical=function(){this._manyArray&&this._manyArray.flushCanonical(),e.prototype.flushCanonical.call(this)},t.prototype.removeRecordFromOwn=function(t,r){if(this.members.has(t)){e.prototype.removeRecordFromOwn.call(this,t,r);var i=this.manyArray;void 0!==r?i.currentState.removeAt(r):i.internalRemoveRecords([t])}},t.prototype.notifyRecordRelationshipAdded=function(e,t){this.record.notifyHasManyAdded(this.key,e,t)},t.prototype.reload=function(){var e=this.manyArray,t=e.get("isLoaded");if(this._loadingPromise){if(this._loadingPromise.get("isPending"))return this._loadingPromise;this._loadingPromise.get("isRejected")&&e.set("isLoaded",t)}var r=void 0;return r=this.link?this.fetchLink():this.store._scheduleFetchMany(e.currentState).then(function(){return e}),this._updateLoadingPromise(r),this._loadingPromise},t.prototype.computeChanges=function(e){var t=this.canonicalMembers,r=[],i=d(e);t.forEach(function(e){i.has(e)||r.push(e)}),this.removeCanonicalRecords(r);for(var a=0,n=e.length;a<n;a++){var o=e[a];this.removeCanonicalRecord(o),this.addCanonicalRecord(o,a)}},t.prototype.fetchLink=function(){var e=this;return this.store.findHasMany(this.record,this.link,this.relationshipMeta).then(function(t){return t.hasOwnProperty("meta")&&e.updateMeta(t.meta),e.store._backburner.join(function(){e.updateRecordsFromAdapter(t),e.manyArray.set("isLoaded",!0)}),e.manyArray})},t.prototype.findRecords=function(){var e=this.manyArray,t=e.currentState;return this.store.findMany(t).then(function(){return e.get("isDestroyed")||e.set("isLoaded",!0),e})},t.prototype.notifyHasManyChanged=function(){this.record.notifyHasManyAdded(this.key)},t.prototype.getRecords=function(){var e=this,t=this.manyArray;if(this.isAsync){var r=void 0;return r=this.link?this.hasLoaded?this.findRecords():this.findLink().then(function(){return e.findRecords()}):this.findRecords(),this._updateLoadingPromise(r,t)}return t.get("isDestroyed")||t.set("isLoaded",!0),t},t.prototype.updateData=function(e){var t=this.store._pushResourceIdentifiers(this,e);this.updateRecordsFromAdapter(t)},l(t,[{key:"_loadingPromise",get:function(){return this.__loadingPromise}},{key:"manyArray",get:function(){return this._manyArray||(this._manyArray=n.default.create({canonicalState:this.canonicalState,store:this.store,relationship:this,type:this.store.modelFor(this.belongsToType),record:this.record,meta:this.meta,isPolymorphic:this.isPolymorphic})),this._manyArray}}]),t}(i.default);e.default=u}),t("ember-data/-private/system/relationships/state/relationship",["exports","ember-data/-private/debug","ember-data/-private/system/ordered-set","ember-data/-private/system/normalize-link"],function(e,t,r,i){e.__esModule=!0;var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),n=function(){function e(e,t,i,a){var n=a.options.async;this.members=new r.default,this.canonicalMembers=new r.default,this.store=e,this.key=a.key,this.inverseKey=i,this.internalModel=t,this.isAsync=void 0===n||n,this.relationshipMeta=a,this.inverseKeyForImplicit=this.internalModel.modelName+this.key,this.linkPromise=null,this.meta=null,this.hasData=!1,this.hasLoaded=!1}return e.prototype.destroy=function(){var e=this;if(this.inverseKey){this.members.toArray().concat(this.canonicalMembers.toArray()).forEach(function(t){var r=t._relationships.get(e.inverseKey);r&&r.inverseDidDematerialize()})}},e.prototype.inverseDidDematerialize=function(){},e.prototype.updateMeta=function(e){this.meta=e},e.prototype.clear=function(){for(var e=this.members.list;e.length>0;){var t=e[0];this.removeRecord(t)}for(var r=this.canonicalMembers.list;r.length>0;){var i=r[0];this.removeCanonicalRecord(i)}},e.prototype.removeRecords=function(e){var t=this;e.forEach(function(e){return t.removeRecord(e)})},e.prototype.addRecords=function(e,t){var r=this;e.forEach(function(e){r.addRecord(e,t),void 0!==t&&t++})},e.prototype.addCanonicalRecords=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.addCanonicalRecord(e[r],r+t):this.addCanonicalRecord(e[r])},e.prototype.addCanonicalRecord=function(t,r){this.canonicalMembers.has(t)||(this.canonicalMembers.add(t),this.inverseKey?t._relationships.get(this.inverseKey).addCanonicalRecord(this.record):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addCanonicalRecord(this.record))),this.flushCanonicalLater(),this.setHasData(!0)},e.prototype.removeCanonicalRecords=function(e,t){for(var r=0;r<e.length;r++)void 0!==t?this.removeCanonicalRecord(e[r],r+t):this.removeCanonicalRecord(e[r])},e.prototype.removeCanonicalRecord=function(e,t){this.canonicalMembers.has(e)&&(this.removeCanonicalRecordFromOwn(e),this.inverseKey?this.removeCanonicalRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeCanonicalRecord(this.record)),this.flushCanonicalLater()},e.prototype.addRecord=function(t,r){this.members.has(t)||(this.members.addWithIndex(t,r),this.notifyRecordRelationshipAdded(t,r),this.inverseKey?t._relationships.get(this.inverseKey).addRecord(this.record):(t._implicitRelationships[this.inverseKeyForImplicit]||(t._implicitRelationships[this.inverseKeyForImplicit]=new e(this.store,t,this.key,{options:{}})),t._implicitRelationships[this.inverseKeyForImplicit].addRecord(this.record)),this.record.updateRecordArrays()),this.setHasData(!0)},e.prototype.removeRecord=function(e){this.members.has(e)&&(this.removeRecordFromOwn(e),this.inverseKey?this.removeRecordFromInverse(e):e._implicitRelationships[this.inverseKeyForImplicit]&&e._implicitRelationships[this.inverseKeyForImplicit].removeRecord(this.record))},e.prototype.removeRecordFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeRecordFromOwn(this.record)},e.prototype.removeRecordFromOwn=function(e){this.members.delete(e),this.notifyRecordRelationshipRemoved(e),this.record.updateRecordArrays()},e.prototype.removeCanonicalRecordFromInverse=function(e){var t=e._relationships.get(this.inverseKey);t&&t.removeCanonicalRecordFromOwn(this.record)},e.prototype.removeCanonicalRecordFromOwn=function(e){this.canonicalMembers.delete(e),this.flushCanonicalLater()},e.prototype.flushCanonical=function(){var e=this.members.list;this.willSync=!1;for(var t=[],r=0;r<e.length;r++)e[r].isNew()&&t.push(e[r]);this.members=this.canonicalMembers.copy();for(var i=0;i<t.length;i++)this.members.add(t[i])},e.prototype.flushCanonicalLater=function(){this.willSync||(this.willSync=!0,this.store._updateRelationshipState(this))},e.prototype.updateLink=function(e){this.link=e,this.linkPromise=null,this.record.notifyPropertyChange(this.key)},e.prototype.findLink=function(){if(this.linkPromise)return this.linkPromise;var e=this.fetchLink();return this.linkPromise=e,e.then(function(e){return e})},e.prototype.updateRecordsFromAdapter=function(e){this.computeChanges(e)},e.prototype.notifyRecordRelationshipAdded=function(){},e.prototype.notifyRecordRelationshipRemoved=function(){},e.prototype.setHasData=function(e){this.hasData=e},e.prototype.setHasLoaded=function(e){this.hasLoaded=e},e.prototype.push=function(e){var t=!1,r=!1;if(e.meta&&this.updateMeta(e.meta),void 0!==e.data&&(t=!0,this.updateData(e.data)),e.links&&e.links.related){var a=(0,i.default)(e.links.related);a&&a.href&&a.href!==this.link&&(r=!0,this.updateLink(a.href))}t?(this.setHasData(!0),this.setHasLoaded(!0)):r&&this.setHasLoaded(!1)},e.prototype.updateData=function(){},a(e,[{key:"record",get:function(){return this.internalModel}},{key:"parentType",get:function(){return this.internalModel.modelName}}]),e}();e.default=n}),t("ember-data/-private/system/snapshot-record-array",["exports"],function(e){function t(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this._snapshots=null,this._recordArray=e,this.length=e.get("length"),this.type=e.get("type"),this.meta=t,this.adapterOptions=r.adapterOptions,this.include=r.include}e.__esModule=!0,e.default=t,t.prototype.snapshots=function(){return null!==this._snapshots?this._snapshots:(this._snapshots=this._recordArray._takeSnapshot(),this._snapshots)}}),t("ember-data/-private/system/snapshot",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){e.__esModule=!0;var i=t.default.get,a=function(){function e(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this._attributes=new r.default,this._belongsToRelationships=new r.default,this._belongsToIds=new r.default,this._hasManyRelationships=new r.default,this._hasManyIds=new r.default,this._internalModel=e;var n=e.getRecord();this.record=n,n.eachAttribute(function(e){return t._attributes[e]=i(n,e)}),this.id=e.id,this.adapterOptions=a.adapterOptions,this.include=a.include,this.type=e.modelClass,this.modelName=e.modelName,this._changedAttributes=n.changedAttributes()}return e.prototype.attr=function(e){if(e in this._attributes)return this._attributes[e];throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no attribute named '"+e+"' defined.")},e.prototype.attributes=function(){return t.default.copy(this._attributes)},e.prototype.changedAttributes=function(){for(var e=new r.default,i=Object.keys(this._changedAttributes),a=0,n=i.length;a<n;a++){var o=i[a];e[o]=t.default.copy(this._changedAttributes[o])}return e},e.prototype.belongsTo=function(e,r){var a=r&&r.id,n=void 0,o=void 0,s=void 0,d=void 0;if(a&&e in this._belongsToIds)return this._belongsToIds[e];if(!a&&e in this._belongsToRelationships)return this._belongsToRelationships[e];if(!(n=this._internalModel._relationships.get(e))||"belongsTo"!==n.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no belongsTo relationship named '"+e+"' defined.");return s=i(n,"hasData"),o=i(n,"inverseRecord"),s&&(d=o&&!o.isDeleted()?a?i(o,"id"):o.createSnapshot():null),a?this._belongsToIds[e]=d:this._belongsToRelationships[e]=d,d},e.prototype.hasMany=function(e,r){var a=r&&r.ids,n=void 0,o=void 0,s=void 0,d=void 0;if(a&&e in this._hasManyIds)return this._hasManyIds[e];if(!a&&e in this._hasManyRelationships)return this._hasManyRelationships[e];if(!(n=this._internalModel._relationships.get(e))||"hasMany"!==n.relationshipMeta.kind)throw new t.default.Error("Model '"+t.default.inspect(this.record)+"' has no hasMany relationship named '"+e+"' defined.");return s=i(n,"hasData"),o=i(n,"members"),s&&(d=[],o.forEach(function(e){e.isDeleted()||(a?d.push(e.id):d.push(e.createSnapshot()))})),a?this._hasManyIds[e]=d:this._hasManyRelationships[e]=d,d},e.prototype.eachAttribute=function(e,t){this.record.eachAttribute(e,t)},e.prototype.eachRelationship=function(e,t){this.record.eachRelationship(e,t)},e.prototype.serialize=function(e){return this.record.store.serializerFor(this.modelName).serialize(this,e)},e}();e.default=a}),t("ember-data/-private/system/store",["exports","ember","ember-data/-private/debug","ember-data/model","ember-data/-private/system/normalize-model-name","ember-data/adapters/errors","ember-data/-private/system/identity-map","ember-data/-private/system/promise-proxies","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers","ember-data/-private/system/store/finders","ember-data/-private/utils","ember-data/-private/system/coerce-id","ember-data/-private/system/record-array-manager","ember-data/-private/system/store/container-instance-cache","ember-data/-private/system/model/internal-model","ember-data/-private/system/empty-object","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,p,f,m,y,v,b){function _(e,t){var r=e.then(function(e){return e.getRecord()});return(0,s.promiseObject)(r,t)}function g(e){return e.serializerFor("application")}function R(e,t,r,i){var a=i._internalModel,o=i.modelName,s=t._modelFor(o),c=e[r](t,s,i),h=(0,u.serializerForAdapter)(t,e,o),p="DS: Extract and notify about "+r+" completion of "+a;return c=j.resolve(c,p),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,t)),c=(0,d._guard)(c,(0,d._bind)(d._objectIsAlive,a)),c.then(function(e){return t._backburner.join(function(){var n=void 0,o=void 0;e&&(n=(0,l.normalizeResponseHelper)(h,t,s,e,i.id,r),n.included&&t._push({data:null,included:n.included}),o=n.data),t.didSaveRecord(a,{data:o})}),a},function(e){if(e instanceof n.InvalidError){var r=h.extractErrors(t,s,e,i.id);t.recordWasInvalid(a,r)}else t.recordWasError(a,e);throw e},p)}function A(e,t,r){r.relationships&&t.type.eachRelationship(function(e,i){if(r.relationships[e]){t._relationships.get(e).push(r.relationships[e])}})}e.__esModule=!0,e.Store=e.badIdFormatAssertion=void 0;var M=(e.badIdFormatAssertion="`id` passed to `findRecord()` has to be non-empty string or number",t.default.A),F=t.default._Backburner,z=t.default.computed,T=t.default.copy,k=t.default.ENV,S=t.default.Error,x=t.default.get,E=(t.default.inspect,t.default.isNone),P=(t.default.isPresent,t.default.MapWithDefault),w=t.default.run,N=t.default.set,D=t.default.RSVP,C=t.default.Service,j=(t.default.typeOf,D.Promise),I=void 0;e.Store=I=C.extend({init:function(){this._super.apply(this,arguments),this._backburner=new F(["normalizeRelationships","syncRelationships","finished"]),this.recordArrayManager=new f.default({store:this}),this._identityMap=new o.default,this._pendingSave=[],this._instanceCache=new m.default((0,h.getOwner)(this),this),this._modelFactoryCache=new v.default,this._pendingSave=[],this._updatedRelationships=[],this._pushedInternalModels=[],this._updatedInternalModels=[],this._pendingFetch=P.create({defaultValue:function(){return[]}}),this._instanceCache=new m.default((0,h.getOwner)(this),this)},adapter:"-json-api",serialize:function(e,t){return e._internalModel.createSnapshot().serialize(t)},defaultAdapter:z("adapter",function(){var e=x(this,"adapter");return this.adapterFor(e)}),createRecord:function(e,t){var r=(0,a.default)(e),i=T(t)||new v.default;E(i.id)&&(i.id=this._generateId(r,i)),i.id=(0,p.default)(i.id);var n=this.buildInternalModel(r,i.id),o=n.getRecord();return n.loadedData(),o.setProperties(i),n.eachRelationship(function(e,t){n._relationships.get(e).setHasData(!0)}),o},_generateId:function(e,t){var r=this.adapterFor(e);return r&&r.generateIdForRecord?r.generateIdForRecord(this,e,t):null},deleteRecord:function(e){e.deleteRecord()},unloadRecord:function(e){e.unloadRecord()},find:function(e,t,r){var i=(0,a.default)(e);return this.findRecord(i,t)},findRecord:function(e,t,r){var i=(0,a.default)(e),n=this._internalModelForId(i,t);return r=r||{},this.hasRecordForId(i,t)?_(this._findRecord(n,r),"DS: Store#findRecord "+i+" with id: "+t):this._findByInternalModel(n,r)},_findRecord:function(e,t){if(t.reload)return this._scheduleFetch(e,t);var r=e.createSnapshot(t),i=this.adapterFor(e.modelName);return i.shouldReloadRecord(this,r)?this._scheduleFetch(e,t):!1===t.backgroundReload?j.resolve(e):((t.backgroundReload||i.shouldBackgroundReloadRecord(this,r))&&this._scheduleFetch(e,t),j.resolve(e))},_findByInternalModel:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.preload&&e.preloadData(t.preload),_(this._findEmptyInternalModel(e,t),"DS: Store#findRecord "+e.modelName+" with id: "+e.id)},_findEmptyInternalModel:function(e,t){return e.isEmpty()?this._scheduleFetch(e,t):e.isLoading()?e._loadingPromise:j.resolve(e)},findByIds:function(e,t){for(var r=new Array(t.length),i=(0,a.default)(e),n=0;n<t.length;n++)r[n]=this.findRecord(i,t[n]);return(0,s.promiseArray)(D.all(r).then(M,null,"DS: Store#findByIds of "+i+" complete"))},_fetchRecord:function(e,t){var r=e.modelName,i=this.adapterFor(r);return(0,c._find)(i,this,e.type,e.id,e,t)},_scheduleFetchMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._scheduleFetch(e[r]);return j.all(t)},_scheduleFetch:function(e,t){if(e._loadingPromise)return e._loadingPromise;var r=e.id,i=e.modelName,a=D.defer("Fetching "+i+"' with id: "+r),n={internalModel:e,resolver:a,options:t},o=a.promise;return e.loadingData(o),0===this._pendingFetch.size&&w.schedule("afterRender",this,this.flushAllPendingFetches),this._pendingFetch.get(i).push(n),o},flushAllPendingFetches:function(){this.isDestroyed||this.isDestroying||(this._pendingFetch.forEach(this._flushPendingFetchForType,this),this._pendingFetch.clear())},_flushPendingFetchForType:function(e,t){function r(e){var t=n._fetchRecord(e.internalModel,e.options);e.resolver.resolve(t)}function i(e,t){for(var r=new v.default,i=0,n=e.length;i<n;i++){var o=e[i],s=u[o.id];if(r[o.id]=o,s){s.resolver.resolve(o)}}for(var d=[],l=0,c=t.length;l<c;l++){var h=t[l];r[h.id]||d.push(h)}d.length&&a(d)}function a(e,t){for(var r=0,i=e.length;r<i;r++){var a=e[r],n=u[a.id];n&&n.resolver.reject(t||new Error("Expected: '"+a+"' to be present in the adapter provided payload, but it was not found."))}}for(var n=this,o=n.adapterFor(t),s=!!o.findMany&&o.coalesceFindRequests,d=e.length,l=new Array(d),u=new v.default,h=0;h<d;h++){var p=e[h],f=p.internalModel;l[h]=f,u[f.id]=p}if(s){for(var m=new Array(d),y=0;y<d;y++)m[y]=l[y].createSnapshot();for(var b=o.groupRecordsForFindMany(this,m),_=0,g=b.length;_<g;_++)!function(e,s){for(var d=b[s],l=b[s].length,h=new Array(l),p=new Array(l),f=0;f<l;f++){var m=d[f]._internalModel;p[f]=m,h[f]=m.id}if(l>1)(0,c._findMany)(o,n,t,h,p).then(function(e){i(e,p)}).catch(function(e){a(p,e)});else if(1===h.length){var y=u[p[0].id];r(y)}}(0,_)}else for(var R=0;R<d;R++)r(e[R])},getReference:function(e,t){var r=(0,a.default)(e);return this._internalModelForId(r,t).recordReference},peekRecord:function(e,t){var r=(0,a.default)(e);return this.hasRecordForId(r,t)?this._internalModelForId(r,t).getRecord():null},_reloadRecord:function(e){var t=(e.id,e.modelName);this.adapterFor(t);return this._scheduleFetch(e)},hasRecordForId:function(e,t){var r=(0,a.default)(e),i=(0,p.default)(t),n=this._internalModelsFor(r).get(i);return!!n&&n.isLoaded()},recordForId:function(e,t){return this._internalModelForId(e,t).getRecord()},_internalModelForId:function(e,t){var r=(0,p.default)(t),i=this._internalModelsFor(e).get(r);return i||(i=this.buildInternalModel(e,r)),i},findMany:function(e){for(var t=new Array(e.length),r=0;r<e.length;r++)t[r]=this._findEmptyInternalModel(e[r]);return j.all(t)},findHasMany:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findHasMany)(i,this,e,t,r)},findBelongsTo:function(e,t,r){var i=this.adapterFor(e.modelName);return(0,c._findBelongsTo)(i,this,e,t,r)},query:function(e,t){var r=(0,a.default)(e);return this._query(r,t)},_query:function(e,t,r){r=r||this.recordArrayManager.createAdapterPopulatedRecordArray(e,t);var i=this.adapterFor(e);return(0,s.promiseArray)((0,c._query)(i,this,e,t,r))},queryRecord:function(e,t){var r=(0,a.default)(e),i=this.adapterFor(r);return(0,s.promiseObject)((0,c._queryRecord)(i,this,e,t).then(function(e){return e?e.getRecord():null}))},findAll:function(e,t){var r=(0,a.default)(e);return this._fetchAll(r,this.peekAll(r),t)},_fetchAll:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.adapterFor(e),a=this._internalModelsFor(e).metadata.since;if(r.reload)return N(t,"isUpdating",!0),(0,s.promiseArray)((0,c._findAll)(i,this,e,a,r));var n=t._createSnapshot(r);return i.shouldReloadAll(this,n)?(N(t,"isUpdating",!0),(0,s.promiseArray)((0,c._findAll)(i,this,e,a,r))):!1===r.backgroundReload?(0,s.promiseArray)(j.resolve(t)):((r.backgroundReload||i.shouldBackgroundReloadAll(this,n))&&(N(t,"isUpdating",!0),(0,c._findAll)(i,this,e,a,r)),(0,s.promiseArray)(j.resolve(t)))},didUpdateAll:function(e){var t=this.recordArrayManager.liveRecordArrayFor(e);N(t,"isUpdating",!1)},peekAll:function(e){var t=(0,a.default)(e),r=this.recordArrayManager.liveRecordArrayFor(t);return this.recordArrayManager.syncLiveRecordArray(r,t),r},unloadAll:function(e){if(0===arguments.length)this._identityMap.clear();else{var t=(0,a.default)(e);this._internalModelsFor(t).clear()}},filter:function(e,t,r){k.ENABLE_DS_FILTER;var i=void 0,n=arguments.length,o=void 0,d=3===n,l=(0,a.default)(e);return d?i=this.query(l,t):2===arguments.length&&(r=t),o=d?this.recordArrayManager.createFilteredRecordArray(l,r,t):this.recordArrayManager.createFilteredRecordArray(l,r),i=i||j.resolve(o),(0,s.promiseArray)(i.then(function(){return o},null,"DS: Store#filter of "+l))},recordIsLoaded:function(e,t){return this.hasRecordForId(e,t)},scheduleSave:function(e,t,r){var i=e.createSnapshot(r);e.flushChangedAttributes(),e.adapterWillCommit(),this._pendingSave.push({snapshot:i,resolver:t}),w.once(this,this.flushPendingSave)},flushPendingSave:function(){var e=this._pendingSave.slice();this._pendingSave=[];for(var t=0,r=e.length;t<r;t++){var i=e[t],a=i.snapshot,n=i.resolver,o=a._internalModel,s=this.adapterFor(o.modelName),d=void 0;if("root.deleted.saved"===o.currentState.stateName)return n.resolve();d=o.isNew()?"createRecord":o.isDeleted()?"deleteRecord":"updateRecord",n.resolve(R(s,this,d,a))}},didSaveRecord:function(e,t){var r=void 0;t&&(r=t.data),r&&(this.updateId(e,r),this._setupRelationshipsForModel(e,r)),e.adapterDidCommit(r)},recordWasInvalid:function(e,t){e.adapterDidInvalidate(t)},recordWasError:function(e,t){e.adapterDidError(t)},updateId:function(e,t){var r=e.id,i=(e.modelName,(0,p.default)(t.id));null!==r&&null===i||(this._internalModelsFor(e.modelName).set(i,e),e.setId(i))},_internalModelsFor:function(e){return this._identityMap.retrieve(e)},_load:function(e){var t=this._internalModelForId(e.type,e.id);return t.setupData(e),this.recordArrayManager.recordDidChange(t),t},_modelForMixin:function(e){var t=(0,h.getOwner)(this),r=void 0;if(t.factoryFor){var a=t.factoryFor("mixin:"+e);r=a&&a.class
|
4
|
+
}else r=t._lookupFactory("mixin:"+e);if(r){var n=i.default.extend(r);n.reopenClass({__isMixin:!0,__mixin:r}),t.register("model:"+e,n)}return this.modelFactoryFor(e)},modelFor:function(e){var t=(0,a.default)(e);return this._modelFor(t)},_modelFor:function(e){var t=this._modelFactoryFor(e);return t.class?t.class:t},_modelFactoryFor:function(e){var t=this._modelFactoryCache[e];if(!t){if(t=this.modelFactoryFor(e),t||(t=this._modelForMixin(e)),!t)throw new S("No model was found for '"+e+"'");var r=(0,h.getOwner)(this).factoryFor?t.class:t;r.modelName=r.modelName||e,this._modelFactoryCache[e]=t}return t},modelFactoryFor:function(e){var t=(0,a.default)(e),r=(0,h.getOwner)(this);return r.factoryFor?r.factoryFor("model:"+t):r._lookupFactory("model:"+t)},push:function(e){var t=this._push(e);if(Array.isArray(t)){return t.map(function(e){return e.getRecord()})}return null===t?null:t.getRecord()},_push:function(e){var t=this;return this._backburner.join(function(){var r=e.included,i=void 0,a=void 0;if(r)for(i=0,a=r.length;i<a;i++)t._pushInternalModel(r[i]);if(Array.isArray(e.data)){a=e.data.length;var n=new Array(a);for(i=0;i<a;i++)n[i]=t._pushInternalModel(e.data[i]);return n}return null===e.data?null:t._pushInternalModel(e.data)})},_hasModelFor:function(e){var t=(0,h.getOwner)(this);return e=(0,a.default)(e),t.factoryFor?!!t.factoryFor("model:"+e):!!t._lookupFactory("model:"+e)},_pushInternalModel:function(e){var t=(e.type,this._load(e));return this._setupRelationshipsForModel(t,e),t},_setupRelationshipsForModel:function(e,t){2===this._pushedInternalModels.push(e,t)&&this._backburner.schedule("normalizeRelationships",this,this._setupRelationships)},_setupRelationships:function(){for(var e=this._pushedInternalModels,t=0,r=e.length;t<r;t+=2){A(this,e[t],e[t+1])}e.length=0},pushPayload:function(e,t){var r=void 0,i=void 0;if(t){i=t;var n=(0,a.default)(e);r=this.serializerFor(n)}else i=e,r=g(this);if((0,b.default)("ds-pushpayload-return"))return r.pushPayload(this,i);r.pushPayload(this,i)},normalize:function(e,t){var r=(0,a.default)(e),i=this.serializerFor(r),n=this._modelFor(r);return i.normalize(n,t)},buildInternalModel:function(e,t,r){var i=this._internalModelsFor(e),a=new y.default(e,t,this,r);return i.add(a,t),a},recordWasLoaded:function(e){this.recordArrayManager.recordWasLoaded(e)},_removeFromIdMap:function(e){var t=this._internalModelsFor(e.modelName),r=e.id;t.remove(e,r)},adapterFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("adapter",t)},serializerFor:function(e){var t=(0,a.default)(e);return this._instanceCache.get("serializer",t)},lookupAdapter:function(e){return this.adapterFor(e)},lookupSerializer:function(e){return this.serializerFor(e)},willDestroy:function(){this._super.apply(this,arguments),this._pushedInternalModels=null,this.recordArrayManager.destroy(),this._instanceCache.destroy(),this.unloadAll()},_updateRelationshipState:function(e){var t=this;1===this._updatedRelationships.push(e)&&this._backburner.join(function(){t._backburner.schedule("syncRelationships",t,t._flushUpdatedRelationships)})},_flushUpdatedRelationships:function(){for(var e=this._updatedRelationships,t=0,r=e.length;t<r;t++)e[t].flushCanonical();e.length=0},_updateInternalModel:function(e){1===this._updatedInternalModels.push(e)&&w.schedule("actions",this,this._flushUpdatedInternalModels)},_flushUpdatedInternalModels:function(){for(var e=this._updatedInternalModels,t=0,r=e.length;t<r;t++)e[t]._triggerDeferredTriggers();e.length=0},_pushResourceIdentifier:function(e,t){if(!E(t))return this._internalModelForId(t.type,t.id)},_pushResourceIdentifiers:function(e,t){if(!E(t)){for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=this._pushResourceIdentifier(e,t[i]);return r}}}),e.Store=I,e.default=I}),t("ember-data/-private/system/store/common",["exports","ember"],function(e,t){function r(e){for(var t=arguments.length,r=Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return function(){return e.apply(void 0,r)}}function i(e,t){var r=e.finally(function(){t()||(r._subscribers.length=0)});return r}function a(e){return!(n(e,"isDestroyed")||n(e,"isDestroying"))}e.__esModule=!0,e._bind=r,e._guard=i,e._objectIsAlive=a;var n=t.default.get}),t("ember-data/-private/system/store/container-instance-cache",["exports","ember","ember-data/-private/system/empty-object"],function(e,t,r){e.__esModule=!0;var i=t.default.set,a=function(){function e(e,t){this.isDestroying=!1,this.isDestroyed=!1,this._owner=e,this._store=t,this._namespaces={adapter:new r.default,serializer:new r.default}}return e.prototype.get=function(e,t){var r=this._namespaces[e];if(r[t])return r[t];var a=e+":"+t,n=this._instanceFor(a)||this._findInstance(e,this._fallbacksFor(e,t));return n&&(r[t]=n,i(n,"store",this._store)),r[t]},e.prototype._fallbacksFor=function(e,t){return"adapter"===e?["application",this._store.get("adapter"),"-json-api"]:["application",this.get("adapter",t).get("defaultSerializer"),"-default"]},e.prototype._findInstance=function(e,t){for(var r=this._namespaces[e],i=0,a=t.length;i<a;i++){var n=t[i];if(r[n])return r[n];var o=e+":"+n,s=this._instanceFor(o);if(s)return r[n]=s,s}},e.prototype._instanceFor=function(e){return this._owner.lookup(e)},e.prototype.destroyCache=function(e){for(var t=Object.keys(e),r=0,i=t.length;r<i;r++){var a=t[r],n=e[a];n&&n.destroy()}},e.prototype.destroy=function(){this.isDestroying=!0,this.destroyCache(this._namespaces.adapter),this.destroyCache(this._namespaces.serializer),this.isDestroyed=!0},e.prototype.toString=function(){return"ContainerInstanceCache"},e}();e.default=a}),t("ember-data/-private/system/store/finders",["exports","ember","ember-data/-private/debug","ember-data/-private/system/store/common","ember-data/-private/system/store/serializer-response","ember-data/-private/system/store/serializers"],function(e,t,r,i,a,n){function o(e,t,r,o,s,d){var l=s.createSnapshot(d),u=s.modelName,c=e.findRecord(t,r,o,l),h=(0,n.serializerForAdapter)(t,e,u),f="DS: Handle Adapter#findRecord of '"+u+"' with id: '"+o+"'";return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){var i=(0,a.normalizeResponseHelper)(h,t,r,e,o,"findRecord");return t._push(i)},function(e){throw s.notFound(),s.isEmpty()&&s.unloadRecord(),e},"DS: Extract payload of '"+u+"'")}function s(e,r,o,s,d){var l=t.default.A(d).invoke("createSnapshot"),u=r.modelFor(o),c=e.findMany(r,u,s,l),h=(0,n.serializerForAdapter)(r,e,o),f="DS: Handle Adapter#findMany of '"+o+"'";if(void 0===c)throw new Error("adapter.findMany returned undefined, this was very likely a mistake");return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,r)),c.then(function(e){var t=(0,a.normalizeResponseHelper)(h,r,u,e,null,"findMany");return r._push(t)},null,"DS: Extract payload of "+o)}function d(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findHasMany(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findHasMany of '"+r.modelName+"' : '"+s.type+"'";return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findHasMany"),i=t._push(r);return i.meta=r.meta,i},null,"DS: Extract payload of '"+r.modelName+"' : hasMany '"+s.type+"'")}function l(e,t,r,o,s){var d=r.createSnapshot(),l=t.modelFor(s.type),u=e.findBelongsTo(t,d,o,s),c=(0,n.serializerForAdapter)(t,e,s.type),h="DS: Handle Adapter#findBelongsTo of "+r.modelName+" : "+s.type;return u=p.resolve(u,h),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,t)),u=(0,i._guard)(u,(0,i._bind)(i._objectIsAlive,r)),u.then(function(e){var r=(0,a.normalizeResponseHelper)(c,t,l,e,null,"findBelongsTo");return r.data?t._push(r):null},null,"DS: Extract payload of "+r.modelName+" : "+s.type)}function u(e,t,r,o,s){var d=t.modelFor(r),l=t.peekAll(r),u=l._createSnapshot(s),c=e.findAll(t,d,o,u),h=(0,n.serializerForAdapter)(t,e,r),f="DS: Handle Adapter#findAll of "+d;return c=p.resolve(c,f),c=(0,i._guard)(c,(0,i._bind)(i._objectIsAlive,t)),c.then(function(e){var i=(0,a.normalizeResponseHelper)(h,t,d,e,null,"findAll");return t._push(i),t.didUpdateAll(r),t.peekAll(r)},null,"DS: Extract payload of findAll ${modelName}")}function c(e,t,r,o,s){var d=t.modelFor(r),l=e.query(t,d,o,s),u=(0,n.serializerForAdapter)(t,e,r),c="DS: Handle Adapter#query of "+d;return l=p.resolve(l,c),l=(0,i._guard)(l,(0,i._bind)(i._objectIsAlive,t)),l.then(function(e){var r=(0,a.normalizeResponseHelper)(u,t,d,e,null,"query"),i=t._push(r);return s._setInternalModels(i,r),s},null,"DS: Extract payload of query "+r)}function h(e,t,r,o){var s=t.modelFor(r),d=e.queryRecord(t,s,o),l=(0,n.serializerForAdapter)(t,e,r),u="DS: Handle Adapter#queryRecord of "+r;return d=p.resolve(d,u),d=(0,i._guard)(d,(0,i._bind)(i._objectIsAlive,t)),d.then(function(e){var r=(0,a.normalizeResponseHelper)(l,t,s,e,null,"queryRecord");return t._push(r)},null,"DS: Extract payload of queryRecord "+r)}e.__esModule=!0,e._find=o,e._findMany=s,e._findHasMany=d,e._findBelongsTo=l,e._findAll=u,e._query=c,e._queryRecord=h;var p=t.default.RSVP.Promise}),t("ember-data/-private/system/store/serializer-response",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){var t=[];return e&&"object"==typeof e?("data"in e||"errors"in e||"meta"in e?"data"in e&&"errors"in e&&t.push('Top level keys "errors" and "data" cannot both be present in a JSON API document'):t.push('One or more of the following keys must be present: "data", "errors", "meta".'),"data"in e&&(null===e.data||Array.isArray(e.data)||"object"==typeof e.data||t.push("data must be null, an object, or an array")),"meta"in e&&"object"!=typeof e.meta&&t.push("meta must be an object"),"errors"in e&&(Array.isArray(e.errors)||t.push("errors must be an array")),"links"in e&&"object"!=typeof e.links&&t.push("links must be an object"),"jsonapi"in e&&"object"!=typeof e.jsonapi&&t.push("jsonapi must be an object"),"included"in e&&"object"!=typeof e.included&&t.push("included must be an array")):t.push("Top level of a JSON API document must be an object"),t}function a(e,t,r,i,a,n){var o=e.normalizeResponse(t,r,i,a,n);return o}e.__esModule=!0,e.validateDocumentStructure=i,e.normalizeResponseHelper=a}),t("ember-data/-private/system/store/serializers",["exports"],function(e){function t(e,t,r){var i=t.serializer;return void 0===i&&(i=e.serializerFor(r)),null!==i&&void 0!==i||(i={extract:function(e,t,r){return r}}),i}e.__esModule=!0,e.serializerForAdapter=t}),t("ember-data/-private/transforms",["exports","ember-data/transform","ember-data/-private/transforms/number","ember-data/-private/transforms/date","ember-data/-private/transforms/string","ember-data/-private/transforms/boolean"],function(e,t,r,i,a,n){e.__esModule=!0,e.BooleanTransform=e.StringTransform=e.DateTransform=e.NumberTransform=e.Transform=void 0,e.Transform=t.default,e.NumberTransform=r.default,e.DateTransform=i.default,e.StringTransform=a.default,e.BooleanTransform=n.default}),t("ember-data/-private/transforms/boolean",["exports","ember","ember-data/transform"],function(e,t,r){e.__esModule=!0;var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e,t){var r=typeof e;return i(e)&&!0===t.allowNull?null:"boolean"===r?e:"string"===r?null!==e.match(/^true$|^t$|^1$/i):"number"===r&&1===e},serialize:function(e,t){return i(e)&&!0===t.allowNull?null:Boolean(e)}})}),t("ember-data/-private/transforms/date",["exports","ember-data/-private/ext/date","ember-data/transform"],function(e,t,r){e.__esModule=!0,e.default=r.default.extend({deserialize:function(e){var r=typeof e;return"string"===r?new Date((0,t.parseDate)(e)):"number"===r?new Date(e):null===e||void 0===e?e:null},serialize:function(e){return e instanceof Date&&!isNaN(e)?e.toISOString():null}})}),t("ember-data/-private/transforms/number",["exports","ember","ember-data/transform"],function(e,t,r){function i(e){return e===e&&e!==1/0&&e!==-1/0}e.__esModule=!0;var a=t.default.isEmpty;e.default=r.default.extend({deserialize:function(e){var t=void 0;return a(e)?null:(t=Number(e),i(t)?t:null)},serialize:function(e){var t=void 0;return a(e)?null:(t=Number(e),i(t)?t:null)}})}),t("ember-data/-private/transforms/string",["exports","ember","ember-data/transform"],function(e,t,r){e.__esModule=!0;var i=t.default.isNone;e.default=r.default.extend({deserialize:function(e){return i(e)?null:String(e)},serialize:function(e){return i(e)?null:String(e)}})}),t("ember-data/-private/utils",["exports","ember"],function(e,t){function r(e){return a(e,"attributes").has("type")||a(e,"relationshipsByName").has("type")}function i(e){var r=void 0;return t.default.getOwner?r=t.default.getOwner(e):e.container&&(r=e.container),r&&r.lookupFactory&&!r._lookupFactory&&(r._lookupFactory=r.lookupFactory,r.register=function(){var e=r.registry||r._registry||r;return e.register.apply(e,arguments)}),r}e.__esModule=!0,e.getOwner=e.modelHasAttributeOrRelationshipNamedType=void 0;var a=t.default.get;e.modelHasAttributeOrRelationshipNamedType=r,e.getOwner=i}),t("ember-data/-private/utils/parse-response-headers",["exports","ember-data/-private/system/empty-object"],function(e,t){function r(e){return Array.isArray(e)?e:Array.from(e)}function i(e){var i=new t.default;return e?(e.split(a).forEach(function(e){var t=e.split(":"),a=r(t),n=a[0],o=a.slice(1);n=n.trim(),(o=o.join(":").trim())&&(i[n]=o)}),i):i}e.__esModule=!0,e.default=i;var a="\r\n"}),t("ember-data/adapter",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({defaultSerializer:"-default",findRecord:null,findAll:null,query:null,queryRecord:null,generateIdForRecord:null,serialize:function(e,t){return e.serialize(t)},createRecord:null,updateRecord:null,deleteRecord:null,coalesceFindRequests:!0,findMany:null,groupRecordsForFindMany:function(e,t){return[t]},shouldReloadRecord:function(e,t){return!1},shouldReloadAll:function(e,t){return!t.length},shouldBackgroundReloadRecord:function(e,t){return!0},shouldBackgroundReloadAll:function(e,t){return!0}})}),t("ember-data/adapters/errors",["exports","ember","ember-data/-private/debug","ember-data/-private/features"],function(e,t,r,i){function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Adapter operation failed";this.isAdapterError=!0,l.call(this,t),this.errors=e||[{title:"Adapter Error",detail:t}]}function n(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.message;return o(e,r)}}function o(e,t){var r=function(r,i){e.call(this,r,i||t)};return r.prototype=Object.create(e.prototype),p&&(r.extend=n(r)),r}function s(e){var r=[];return t.default.isPresent(e)&&Object.keys(e).forEach(function(i){for(var a=t.default.makeArray(e[i]),n=0;n<a.length;n++){var o="Invalid Attribute",s="/data/attributes/"+i;i===h&&(o="Invalid Document",s="/data"),r.push({title:o,detail:a[n],source:{pointer:s}})}}),r}function d(e){var r={};return t.default.isPresent(e)&&e.forEach(function(e){if(e.source&&e.source.pointer){var t=e.source.pointer.match(u);t?t=t[2]:-1!==e.source.pointer.search(c)&&(t=h),t&&(r[t]=r[t]||[],r[t].push(e.detail||e.title))}}),r}e.__esModule=!0,e.ServerError=e.ConflictError=e.NotFoundError=e.ForbiddenError=e.UnauthorizedError=e.AbortError=e.TimeoutError=e.InvalidError=void 0,e.AdapterError=a,e.errorsHashToArray=s,e.errorsArrayToHash=d;var l=t.default.Error,u=/^\/?data\/(attributes|relationships)\/(.*)/,c=/^\/?data/,h="base",p=!1;p=!0,a.prototype=Object.create(l.prototype),p&&(a.extend=n(a));e.InvalidError=o(a,"The adapter rejected the commit because it was invalid"),e.TimeoutError=o(a,"The adapter operation timed out"),e.AbortError=o(a,"The adapter operation was aborted"),e.UnauthorizedError=p?o(a,"The adapter operation is unauthorized"):null,e.ForbiddenError=p?o(a,"The adapter operation is forbidden"):null,e.NotFoundError=p?o(a,"The adapter could not find the resource"):null,e.ConflictError=p?o(a,"The adapter operation failed due to a conflict"):null,e.ServerError=p?o(a,"The adapter operation failed due to a server error"):null}),t("ember-data/adapters/json-api",["exports","ember","ember-data/adapters/rest","ember-data/-private/features","ember-data/-private/debug"],function(e,t,r,i,a){e.__esModule=!0;var n=r.default.extend({defaultSerializer:"-json-api",ajaxOptions:function(e,t,r){var i=this._super.apply(this,arguments);i.contentType&&(i.contentType="application/vnd.api+json");var a=i.beforeSend;return i.beforeSend=function(e){e.setRequestHeader("Accept","application/vnd.api+json"),a&&a(e)},i},coalesceFindRequests:!1,findMany:function(e,t,r,a){if((0,i.default)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var n=this.buildURL(t.modelName,r,a,"findMany");return this.ajax(n,"GET",{data:{filter:{id:r.join(",")}}})},pathForType:function(e){var r=t.default.String.dasherize(e);return t.default.String.pluralize(r)},updateRecord:function(e,t,r){if((0,i.default)("ds-improved-ajax")&&!this._hasCustomizedAjax())return this._super.apply(this,arguments);var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,r,{includeId:!0});var n=this.buildURL(t.modelName,r.id,r,"updateRecord");return this.ajax(n,"PATCH",{data:a})},_hasCustomizedAjax:function(){return this.ajax!==n.prototype.ajax||this.ajaxOptions!==n.prototype.ajaxOptions}});(0,i.default)("ds-improved-ajax")&&n.reopen({methodForRequest:function(e){return"updateRecord"===e.requestType?"PATCH":this._super.apply(this,arguments)},dataForRequest:function(e){var t=e.requestType,r=e.ids;if("findMany"===t)return{filter:{id:r.join(",")}};if("updateRecord"===t){var i=e.store,a=e.type,n=e.snapshot,o={};return i.serializerFor(a.modelName).serializeIntoHash(o,a,n,{includeId:!0}),o}return this._super.apply(this,arguments)},headersForRequest:function(){var e=this._super.apply(this,arguments)||{};return e.Accept="application/vnd.api+json",e},_requestToJQueryAjaxHash:function(){var e=this._super.apply(this,arguments);return e.contentType&&(e.contentType="application/vnd.api+json"),e}}),e.default=n}),t("ember-data/adapters/rest",["exports","ember","ember-data/adapter","ember-data/adapters/errors","ember-data/-private/adapters/build-url-mixin","ember-data/-private/features","ember-data/-private/debug","ember-data/-private/utils/parse-response-headers"],function(e,t,r,i,a,n,o,s){function d(e,t,r,i){var a=void 0;try{a=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),r,i)}catch(e){return p.reject(e)}return a&&a.isAdapterError?p.reject(a):a}function l(e,t,r,a){var n=void 0;if(a.errorThrown instanceof Error)n=a.errorThrown;else if("timeout"===a.textStatus)n=new i.TimeoutError;else if("abort"===a.textStatus||0===t.status)n=new i.AbortError;else try{n=e.handleResponse(t.status,(0,s.default)(t.getAllResponseHeaders()),e.parseErrorResponse(t.responseText)||a.errorThrown,r)}catch(e){n=e}return n}function u(e,t){return"function"!=typeof String.prototype.endsWith?-1!==e.indexOf(t,e.length-t.length):e.endsWith(t)}e.__esModule=!0;var c=t.default.MapWithDefault,h=t.default.get,p=t.default.RSVP.Promise,f=r.default.extend(a.default,{defaultSerializer:"-rest",sortQueryParams:function(e){var t=Object.keys(e),r=t.length;if(r<2)return e;for(var i={},a=t.sort(),n=0;n<r;n++)i[a[n]]=e[a[n]];return i},coalesceFindRequests:!1,findRecord:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,id:r,snapshot:i,requestType:"findRecord"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,i,"findRecord"),s=this.buildQuery(i);return this.ajax(o,"GET",{data:s})},findAll:function(e,t,r,i){var a=this.buildQuery(i);if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var o=this._requestFor({store:e,type:t,sinceToken:r,query:a,snapshots:i,requestType:"findAll"});return this._makeRequest(o)}var s=this.buildURL(t.modelName,null,i,"findAll");return r&&(a.since=r),this.ajax(s,"GET",{data:a})},query:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,query:r,requestType:"query"});return this._makeRequest(i)}var a=this.buildURL(t.modelName,null,null,"query",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},queryRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,query:r,requestType:"queryRecord"});return this._makeRequest(i)}var a=this.buildURL(t.modelName,null,null,"queryRecord",r);return this.sortQueryParams&&(r=this.sortQueryParams(r)),this.ajax(a,"GET",{data:r})},findMany:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,type:t,ids:r,snapshots:i,requestType:"findMany"});return this._makeRequest(a)}var o=this.buildURL(t.modelName,r,i,"findMany");return this.ajax(o,"GET",{data:{ids:r}})},findHasMany:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:i,requestType:"findHasMany"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findHasMany")),this.ajax(r,"GET")},findBelongsTo:function(e,t,r,i){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var a=this._requestFor({store:e,snapshot:t,url:r,relationship:i,requestType:"findBelongsTo"});return this._makeRequest(a)}var o=t.id,s=t.modelName;return r=this.urlPrefix(r,this.buildURL(s,o,t,"findBelongsTo")),this.ajax(r,"GET")},createRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,snapshot:r,requestType:"createRecord"});return this._makeRequest(i)}var a={},o=e.serializerFor(t.modelName),s=this.buildURL(t.modelName,null,r,"createRecord");return o.serializeIntoHash(a,t,r,{includeId:!0}),this.ajax(s,"POST",{data:a})},updateRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,snapshot:r,requestType:"updateRecord"});return this._makeRequest(i)}var a={};e.serializerFor(t.modelName).serializeIntoHash(a,t,r);var o=r.id,s=this.buildURL(t.modelName,o,r,"updateRecord");return this.ajax(s,"PUT",{data:a})},deleteRecord:function(e,t,r){if((0,n.default)("ds-improved-ajax")&&!this._hasCustomizedAjax()){var i=this._requestFor({store:e,type:t,snapshot:r,requestType:"deleteRecord"});return this._makeRequest(i)}var a=r.id;return this.ajax(this.buildURL(t.modelName,a,r,"deleteRecord"),"DELETE")},_stripIDFromURL:function(e,t){var r=this.buildURL(t.modelName,t.id,t),i=r.split("/"),a=i[i.length-1],n=t.id;return decodeURIComponent(a)===n?i[i.length-1]="":u(a,"?id="+n)&&(i[i.length-1]=a.substring(0,a.length-n.length-1)),i.join("/")},maxURLLength:2048,groupRecordsForFindMany:function(e,t){function r(t,r,i){var n=0,o=a._stripIDFromURL(e,t[0]),s=[[]];return t.forEach(function(e){var t=encodeURIComponent(e.id).length+i;o.length+n+t>=r&&(n=0,s.push([])),n+=t;var a=s.length-1;s[a].push(e)}),s}var i=c.create({defaultValue:function(){return[]}}),a=this,n=this.maxURLLength;t.forEach(function(t){var r=a._stripIDFromURL(e,t);i.get(r).push(t)});var o=[];return i.forEach(function(e,t){r(e,n,"&ids%5B%5D=".length).forEach(function(e){return o.push(e)})}),o},handleResponse:function(e,t,r,a){if(this.isSuccess(e,t,r))return r;if(this.isInvalid(e,t,r))return new i.InvalidError(r.errors);var n=this.normalizeErrorResponse(e,t,r),o=this.generatedDetailedMessage(e,t,r,a);switch(e){case 401:return new i.UnauthorizedError(n,o);case 403:return new i.ForbiddenError(n,o);case 404:return new i.NotFoundError(n,o);case 409:return new i.ConflictError(n,o);default:if(e>=500)return new i.ServerError(n,o)}return new i.AdapterError(n,o)},isSuccess:function(e,t,r){return e>=200&&e<300||304===e},isInvalid:function(e,t,r){return 422===e},ajax:function(e,r,i){var a=this,n={url:e,method:r};return new p(function(o,s){var u=a.ajaxOptions(e,r,i);u.success=function(e,r,i){var s=d(a,i,e,n);t.default.run.join(null,o,s)},u.error=function(e,r,i){var o={textStatus:r,errorThrown:i},d=l(a,e,n,o);t.default.run.join(null,s,d)},a._ajaxRequest(u)},"DS: RESTAdapter#ajax "+r+" to "+e)},_ajaxRequest:function(e){t.default.$.ajax(e)},ajaxOptions:function(e,t,r){var i=r||{};i.url=e,i.type=t,i.dataType="json",i.context=this,i.data&&"GET"!==t&&(i.contentType="application/json; charset=utf-8",i.data=JSON.stringify(i.data));var a=h(this,"headers");return void 0!==a&&(i.beforeSend=function(e){Object.keys(a).forEach(function(t){return e.setRequestHeader(t,a[t])})}),i},parseErrorResponse:function(e){var r=e;try{r=t.default.$.parseJSON(e)}catch(e){}return r},normalizeErrorResponse:function(e,t,r){return r&&"object"==typeof r&&r.errors?r.errors:[{status:""+e,title:"The backend responded with an error",detail:""+r}]},generatedDetailedMessage:function(e,t,r,i){var a=void 0,n=t["Content-Type"]||"Empty Content-Type";return a="text/html"===n&&r.length>250?"[Omitted Lengthy HTML]":r,["Ember Data Request "+i.method+" "+i.url+" returned a "+e,"Payload ("+n+")",a].join("\n")},buildQuery:function(e){var t={};if(e){var r=e.include;r&&(t.include=r)}return t},_hasCustomizedAjax:function(){return this.ajax!==f.prototype.ajax||this.ajaxOptions!==f.prototype.ajaxOptions}});(0,n.default)("ds-improved-ajax")&&f.reopen({dataForRequest:function(e){var t=e.store,r=e.type,i=e.snapshot,a=e.requestType,n=e.query;r=r||i&&i.type;var o=t.serializerFor(r.modelName),s={};switch(a){case"createRecord":o.serializeIntoHash(s,r,i,{includeId:!0});break;case"updateRecord":o.serializeIntoHash(s,r,i);break;case"findRecord":s=this.buildQuery(i);break;case"findAll":e.sinceToken&&(n=n||{},n.since=e.sinceToken),s=n;break;case"query":case"queryRecord":this.sortQueryParams&&(n=this.sortQueryParams(n)),s=n;break;case"findMany":s={ids:e.ids};break;default:s=void 0}return s},methodForRequest:function(e){switch(e.requestType){case"createRecord":return"POST";case"updateRecord":return"PUT";case"deleteRecord":return"DELETE"}return"GET"},urlForRequest:function(e){var t=e.type,r=e.id,i=e.ids,a=e.snapshot,n=e.snapshots,o=e.requestType,s=e.query;switch(t=t||a&&a.type,r=r||a&&a.id,o){case"findAll":return this.buildURL(t.modelName,null,n,o);case"query":case"queryRecord":return this.buildURL(t.modelName,null,null,o,s);case"findMany":return this.buildURL(t.modelName,i,n,o);case"findHasMany":case"findBelongsTo":var d=this.buildURL(t.modelName,r,a,o);return this.urlPrefix(e.url,d)}return this.buildURL(t.modelName,r,a,o,s)},headersForRequest:function(e){return this.get("headers")},_requestFor:function(e){return{method:this.methodForRequest(e),url:this.urlForRequest(e),headers:this.headersForRequest(e),data:this.dataForRequest(e)}},_requestToJQueryAjaxHash:function(e){var t={};t.type=e.method,t.url=e.url,t.dataType="json",t.context=this,e.data&&("GET"!==e.method?(t.contentType="application/json; charset=utf-8",t.data=JSON.stringify(e.data)):t.data=e.data);var r=e.headers;return void 0!==r&&(t.beforeSend=function(e){Object.keys(r).forEach(function(t){return e.setRequestHeader(t,r[t])})}),t},_makeRequest:function(e){var r=this,i=this._requestToJQueryAjaxHash(e),a=e.method,n=e.url,o={method:a,url:n};return new t.default.RSVP.Promise(function(e,a){i.success=function(i,a,n){var s=d(r,n,i,o);t.default.run.join(null,e,s)},i.error=function(e,i,n){var s={textStatus:i,errorThrown:n},d=l(r,e,o,s);t.default.run.join(null,a,d)},r._ajaxRequest(i)},"DS: RESTAdapter#makeRequest: "+a+" "+n)}}),e.default=f}),t("ember-data/attr",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e,t,r){return"function"==typeof t.defaultValue?t.defaultValue.apply(null,arguments):t.defaultValue}function a(e,t){return t in e._attributes||t in e._inFlightAttributes||t in e._data}function n(e,t){return t in e._attributes?e._attributes[t]:t in e._inFlightAttributes?e._inFlightAttributes[t]:e._data[t]}function o(e,r){"object"==typeof e?(r=e,e=void 0):r=r||{};var o={type:e,isAttribute:!0,options:r};return t.default.computed({get:function(e){var t=this._internalModel;return a(t,e)?n(t,e):i(this,r,e)},set:function(e,t){var r=this._internalModel,i=n(r,e),a=void 0;return t!==i&&(r._attributes[e]=t,a=e in r._inFlightAttributes?r._inFlightAttributes[e]:r._data[e],this._internalModel.send("didSetProperty",{name:e,oldValue:i,originalValue:a,value:t})),t}}).meta(o)}e.__esModule=!0,e.default=o}),t("ember-data",["exports","ember","ember-data/-private/debug","ember-data/-private/features","ember-data/-private/global","ember-data/-private/core","ember-data/-private/system/normalize-model-name","ember-data/-private/system/model/internal-model","ember-data/-private/system/promise-proxies","ember-data/-private/system/store","ember-data/-private/system/model","ember-data/model","ember-data/-private/system/snapshot","ember-data/adapter","ember-data/serializer","ember-data/adapters/errors","ember-data/-private/system/record-arrays","ember-data/-private/system/many-array","ember-data/-private/system/record-array-manager","ember-data/-private/adapters","ember-data/-private/adapters/build-url-mixin","ember-data/-private/serializers","ember-data/serializers/embedded-records-mixin","ember-data/-private/transforms","ember-data/relationships","ember-data/setup-container","ember-data/-private/instance-initializers/initialize-store-service","ember-data/-private/system/relationships/state/relationship","ember-inflector"],function(e,t,r,i,a,n,o,s,d,l,u,c,h,p,f,m,y,v,b,_,g,R,A,M,F,z,T,k){if(e.__esModule=!0,t.default.VERSION.match(/^1\.([0-9]|1[0-2])\./))throw new t.default.Error("Ember Data requires at least Ember 1.13.0, but you have "+t.default.VERSION+". Please upgrade your version of Ember, then upgrade Ember Data.");n.default.Store=l.Store,n.default.PromiseArray=d.PromiseArray,n.default.PromiseObject=d.PromiseObject,n.default.PromiseManyArray=d.PromiseManyArray,n.default.Model=c.default,n.default.RootState=u.RootState,n.default.attr=u.attr,n.default.Errors=u.Errors,n.default.InternalModel=s.default,n.default.Snapshot=h.default,n.default.Adapter=p.default,n.default.AdapterError=m.AdapterError,n.default.InvalidError=m.InvalidError,n.default.TimeoutError=m.TimeoutError,n.default.AbortError=m.AbortError,n.default.UnauthorizedError=m.UnauthorizedError,n.default.ForbiddenError=m.ForbiddenError,n.default.NotFoundError=m.NotFoundError,n.default.ConflictError=m.ConflictError,n.default.ServerError=m.ServerError,n.default.errorsHashToArray=m.errorsHashToArray,n.default.errorsArrayToHash=m.errorsArrayToHash,n.default.Serializer=f.default,n.default.DebugAdapter=r.default,n.default.RecordArray=y.RecordArray,n.default.FilteredRecordArray=y.FilteredRecordArray,n.default.AdapterPopulatedRecordArray=y.AdapterPopulatedRecordArray,n.default.ManyArray=v.default,n.default.RecordArrayManager=b.default,n.default.RESTAdapter=_.RESTAdapter,n.default.BuildURLMixin=g.default,n.default.RESTSerializer=R.RESTSerializer,n.default.JSONSerializer=R.JSONSerializer,n.default.JSONAPIAdapter=_.JSONAPIAdapter,n.default.JSONAPISerializer=R.JSONAPISerializer,n.default.Transform=M.Transform,n.default.DateTransform=M.DateTransform,n.default.StringTransform=M.StringTransform,n.default.NumberTransform=M.NumberTransform,n.default.BooleanTransform=M.BooleanTransform,n.default.EmbeddedRecordsMixin=A.default,n.default.belongsTo=F.belongsTo,n.default.hasMany=F.hasMany,n.default.Relationship=k.default,n.default._setupContainer=z.default,n.default._initializeStoreService=T.default,Object.defineProperty(n.default,"normalizeModelName",{enumerable:!0,writable:!1,configurable:!1,value:o.default}),Object.defineProperty(a.default,"DS",{configurable:!0,get:function(){return n.default}}),e.default=n.default}),t("ember-data/initializers/data-adapter",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"data-adapter",before:"store",initialize:function(){}}}),t("ember-data/initializers/ember-data",["exports","ember-data/setup-container","ember-data/index"],function(e,t){e.__esModule=!0,e.default={
|
5
|
+
name:"ember-data",initialize:t.default}}),t("ember-data/initializers/injectStore",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"injectStore",before:"store",initialize:function(){}}}),t("ember-data/initializers/store",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"store",after:"ember-data",initialize:function(){}}}),t("ember-data/initializers/transforms",["exports","ember"],function(e,t){e.__esModule=!0,e.default={name:"transforms",before:"store",initialize:function(){}}}),t("ember-data/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e.__esModule=!0,e.default={name:"ember-data",initialize:t.default}}),t("ember-data/model",["exports","ember-data/-private/system/model"],function(e,t){e.__esModule=!0,e.default=t.default}),t("ember-data/relationships",["exports","ember-data/-private/system/relationships/belongs-to","ember-data/-private/system/relationships/has-many"],function(e,t,r){e.__esModule=!0,e.hasMany=e.belongsTo=void 0,e.belongsTo=t.default,e.hasMany=r.default}),t("ember-data/serializer",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({normalizeResponse:null,serialize:null,normalize:function(e,t){return t}})}),t("ember-data/serializers/embedded-records-mixin",["exports","ember","ember-data/-private/debug"],function(e,t,r){function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.__esModule=!0;var a=t.default.get,n=t.default.set,o=t.default.String.camelize;e.default=t.default.Mixin.create({normalize:function(e,t,r){var i=this._super(e,t,r);return this._extractEmbeddedRecords(this,this.store,e,i)},keyForRelationship:function(e,t,r){return"serialize"===r&&this.hasSerializeRecordsOption(e)||"deserialize"===r&&this.hasDeserializeRecordsOption(e)?this.keyForAttribute(e,r):this._super(e,t,r)||e},serializeBelongsTo:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);var a=this.hasSerializeIdsOption(i),n=this.hasSerializeRecordsOption(i),o=e.belongsTo(i);if(a){var s=this._getMappedKey(r.key,e.type);s===r.key&&this.keyForRelationship&&(s=this.keyForRelationship(r.key,r.kind,"serialize")),o?(t[s]=o.id,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[s]=null}else n&&this._serializeEmbeddedBelongsTo(e,t,r)},_serializeEmbeddedBelongsTo:function(e,t,r){var i=e.belongsTo(r.key),a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),i?(t[a]=i.serialize({includeId:!0}),this.removeEmbeddedForeignKey(e,i,r,t[a]),r.options.polymorphic&&this.serializePolymorphicType(e,t,r)):t[a]=null},serializeHasMany:function(e,t,r){var i=r.key;if(this.noSerializeOptionSpecified(i))return void this._super(e,t,r);if(this.hasSerializeIdsOption(i)){var a=this._getMappedKey(r.key,e.type);a===r.key&&this.keyForRelationship&&(a=this.keyForRelationship(r.key,r.kind,"serialize")),t[a]=e.hasMany(i,{ids:!0})}else this.hasSerializeRecordsOption(i)?this._serializeEmbeddedHasMany(e,t,r):this.hasSerializeIdsAndTypesOption(i)&&this._serializeHasManyAsIdsAndTypes(e,t,r)},_serializeHasManyAsIdsAndTypes:function(e,r,i){var a=this.keyForAttribute(i.key,"serialize"),n=e.hasMany(i.key);r[a]=t.default.A(n).map(function(e){return{id:e.id,type:e.modelName}})},_serializeEmbeddedHasMany:function(e,t,r){var i=this._getMappedKey(r.key,e.type);i===r.key&&this.keyForRelationship&&(i=this.keyForRelationship(r.key,r.kind,"serialize")),t[i]=this._generateSerializedHasMany(e,r)},_generateSerializedHasMany:function(e,r){for(var i=e.hasMany(r.key),a=t.default.A(i),n=new Array(a.length),o=0;o<a.length;o++){var s=a[o],d=s.serialize({includeId:!0});this.removeEmbeddedForeignKey(e,s,r,d),n[o]=d}return n},removeEmbeddedForeignKey:function(e,t,r,i){if("belongsTo"===r.kind){var a=e.type.inverseFor(r.key,this.store);if(a){var n=a.name,o=this.store.serializerFor(t.modelName),s=o.keyForRelationship(n,a.kind,"deserialize");s&&delete i[s]}}},hasEmbeddedAlwaysOption:function(e){var t=this.attrsOption(e);return t&&"always"===t.embedded},hasSerializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.serialize},hasSerializeIdsOption:function(e){var t=this.attrsOption(e);return t&&("ids"===t.serialize||"id"===t.serialize)},hasSerializeIdsAndTypesOption:function(e){var t=this.attrsOption(e);return t&&("ids-and-types"===t.serialize||"id-and-type"===t.serialize)},noSerializeOptionSpecified:function(e){var t=this.attrsOption(e);return!(t&&(t.serialize||t.embedded))},hasDeserializeRecordsOption:function(e){var t=this.hasEmbeddedAlwaysOption(e),r=this.attrsOption(e);return t||r&&"records"===r.deserialize},attrsOption:function(e){var t=this.get("attrs");return t&&(t[o(e)]||t[e])},_extractEmbeddedRecords:function(e,t,r,i){var a=this;return r.eachRelationship(function(r,n){e.hasDeserializeRecordsOption(r)&&("hasMany"===n.kind&&a._extractEmbeddedHasMany(t,r,i,n),"belongsTo"===n.kind&&a._extractEmbeddedBelongsTo(t,r,i,n))}),i},_extractEmbeddedHasMany:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){for(var d=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=this._normalizeEmbeddedRelationship(e,o,u),h=c.data,p=c.included;if(r.included=r.included||[],r.included.push(h),p){var f;(f=r.included).push.apply(f,i(p))}d[l]={id:h.id,type:h.type}}n(r,"data.relationships."+t,{data:d})}},_extractEmbeddedBelongsTo:function(e,t,r,o){var s=a(r,"data.relationships."+t+".data");if(s){var d=this._normalizeEmbeddedRelationship(e,o,s),l=d.data,u=d.included;if(r.included=r.included||[],r.included.push(l),u){var c;(c=r.included).push.apply(c,i(u))}var h={id:l.id,type:l.type};n(r,"data.relationships."+t,{data:h})}},_normalizeEmbeddedRelationship:function(e,t,r){var i=t.type;t.options.polymorphic&&(i=r.type);var a=e.modelFor(i);return e.serializerFor(i).normalize(a,r,null)},isEmbeddedRecordsMixin:!0})}),t("ember-data/serializers/json-api",["exports","ember","ember-inflector","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-data/-private/features"],function(e,t,r,i,a,n,o){e.__esModule=!0;var s=t.default.String.dasherize,d=a.default.extend({_normalizeDocumentHelper:function(e){if("object"===t.default.typeOf(e.data))e.data=this._normalizeResourceHelper(e.data);else if(Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeResourceHelper(a)}e.data=r}if(Array.isArray(e.included)){for(var n=new Array(e.included.length),o=0;o<e.included.length;o++){var s=e.included[o];n[o]=this._normalizeResourceHelper(s)}e.included=n}return e},_normalizeRelationshipDataHelper:function(e){if((0,o.default)("ds-payload-type-hooks")){var t=this.modelNameFromPayloadType(e.type),r=this.modelNameFromPayloadKey(e.type);t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r),e.type=t}else e.type=this.modelNameFromPayloadKey(e.type);return e},_normalizeResourceHelper:function(e){var t=void 0;if((0,o.default)("ds-payload-type-hooks")){t=this.modelNameFromPayloadType(e.type);var r=this.modelNameFromPayloadKey(e.type);"modelNameFromPayloadType",t!==r&&this._hasCustomModelNameFromPayloadKey()&&(t=r,"modelNameFromPayloadKey")}else t=this.modelNameFromPayloadKey(e.type),"modelNameFromPayloadKey";if(!this.store._hasModelFor(t))return null;var i=this.store._modelFor(t);return this.store.serializerFor(t).normalize(i,e).data},pushPayload:function(e,t){var r=this._normalizeDocumentHelper(t);if((0,o.default)("ds-pushpayload-return"))return e.push(r);e.push(r)},_normalizeResponse:function(e,t,r,i,a,n){return this._normalizeDocumentHelper(r)},normalizeQueryRecordResponse:function(){return this._super.apply(this,arguments)},extractAttributes:function(e,t){var r=this,i={};return t.attributes&&e.eachAttribute(function(e){var a=r.keyForAttribute(e,"deserialize");void 0!==t.attributes[a]&&(i[e]=t.attributes[a])}),i},extractRelationship:function(e){if("object"===t.default.typeOf(e.data)&&(e.data=this._normalizeRelationshipDataHelper(e.data)),Array.isArray(e.data)){for(var r=new Array(e.data.length),i=0;i<e.data.length;i++){var a=e.data[i];r[i]=this._normalizeRelationshipDataHelper(a)}e.data=r}return e},extractRelationships:function(e,t){var r=this,i={};return t.relationships&&e.eachRelationship(function(e,a){var n=r.keyForRelationship(e,a.kind,"deserialize");if(void 0!==t.relationships[n]){var o=t.relationships[n];i[e]=r.extractRelationship(o)}}),i},_extractType:function(e,t){if((0,o.default)("ds-payload-type-hooks")){var r=this.modelNameFromPayloadType(t.type),i=this.modelNameFromPayloadKey(t.type);return r!==i&&this._hasCustomModelNameFromPayloadKey()&&(r=i),r}return this.modelNameFromPayloadKey(t.type)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.default)(e))},payloadKeyFromModelName:function(e){return(0,r.pluralize)(e)},normalize:function(e,t){t.attributes&&this.normalizeUsingDeclaredMapping(e,t.attributes),t.relationships&&this.normalizeUsingDeclaredMapping(e,t.relationships);var r={id:this.extractId(e,t),type:this._extractType(e,t),attributes:this.extractAttributes(e,t),relationships:this.extractRelationships(e,t)};return this.applyTransforms(e,r.attributes),{data:r}},keyForAttribute:function(e,t){return s(e)},keyForRelationship:function(e,t,r){return s(e)},serialize:function(e,t){var r=this._super.apply(this,arguments),i=void 0;if((0,o.default)("ds-payload-type-hooks")){i=this.payloadTypeFromModelName(e.modelName);var a=this.payloadKeyFromModelName(e.modelName);i!==a&&this._hasCustomPayloadKeyFromModelName()&&(i=a)}else i=this.payloadKeyFromModelName(e.modelName);return r.type=i,{data:r}},serializeAttribute:function(e,t,r,i){var a=i.type;if(this._canSerialize(r)){t.attributes=t.attributes||{};var n=e.attr(r);if(a){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&(o=this.keyForAttribute(r,"serialize")),t.attributes[o]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i);if(void 0!==a){t.relationships=t.relationships||{};var n=this._getMappedKey(i,e.type);n===i&&(n=this.keyForRelationship(i,"belongsTo","serialize"));var s=null;if(a){var d=void 0;if((0,o.default)("ds-payload-type-hooks")){d=this.payloadTypeFromModelName(a.modelName);var l=this.payloadKeyFromModelName(a.modelName);d!==l&&this._hasCustomPayloadKeyFromModelName()&&(d=l)}else d=this.payloadKeyFromModelName(a.modelName);s={type:d,id:a.id}}t.relationships[n]={data:s}}}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(a="shouldSerializeHasMany",this[a](e,i,r)){var n=e.hasMany(i);if(void 0!==n){t.relationships=t.relationships||{};var s=this._getMappedKey(i,e.type);s===i&&this.keyForRelationship&&(s=this.keyForRelationship(i,"hasMany","serialize"));for(var d=new Array(n.length),l=0;l<n.length;l++){var u=n[l],c=void 0;if((0,o.default)("ds-payload-type-hooks")){c=this.payloadTypeFromModelName(u.modelName);var h=this.payloadKeyFromModelName(u.modelName);c!==h&&this._hasCustomPayloadKeyFromModelName()&&(c=h)}else c=this.payloadKeyFromModelName(u.modelName);d[l]={type:c,id:u.id}}t.relationships[s]={data:d}}}}});(0,o.default)("ds-payload-type-hooks")&&d.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.default)(e))},payloadTypeFromModelName:function(e){return(0,r.pluralize)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==d.prototype.modelNameFromPayloadKey},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==d.prototype.payloadKeyFromModelName}}),e.default=d}),t("ember-data/serializers/json",["exports","ember","ember-data/-private/debug","ember-data/serializer","ember-data/-private/system/coerce-id","ember-data/-private/system/normalize-model-name","ember-data/-private/utils","ember-data/-private/features","ember-data/adapters/errors"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.__esModule=!0;var u=t.default.get,c=t.default.isNone,h=t.default.assign||t.default.merge,p=i.default.extend({primaryKey:"id",mergedProperties:["attrs"],applyTransforms:function(e,t){var r=this,i=u(e,"attributes");return e.eachTransformedAttribute(function(e,a){if(void 0!==t[e]){var n=r.transformFor(a),o=i.get(e);t[e]=n.deserialize(t[e],o.options)}}),t},normalizeResponse:function(e,t,r,i,a){switch(a){case"findRecord":return this.normalizeFindRecordResponse.apply(this,arguments);case"queryRecord":return this.normalizeQueryRecordResponse.apply(this,arguments);case"findAll":return this.normalizeFindAllResponse.apply(this,arguments);case"findBelongsTo":return this.normalizeFindBelongsToResponse.apply(this,arguments);case"findHasMany":return this.normalizeFindHasManyResponse.apply(this,arguments);case"findMany":return this.normalizeFindManyResponse.apply(this,arguments);case"query":return this.normalizeQueryResponse.apply(this,arguments);case"createRecord":return this.normalizeCreateRecordResponse.apply(this,arguments);case"deleteRecord":return this.normalizeDeleteRecordResponse.apply(this,arguments);case"updateRecord":return this.normalizeUpdateRecordResponse.apply(this,arguments)}},normalizeFindRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeQueryRecordResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindAllResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindBelongsToResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeFindHasManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeFindManyResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeQueryResponse:function(e,t,r,i,a){return this.normalizeArrayResponse.apply(this,arguments)},normalizeCreateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeDeleteRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeUpdateRecordResponse:function(e,t,r,i,a){return this.normalizeSaveResponse.apply(this,arguments)},normalizeSaveResponse:function(e,t,r,i,a){return this.normalizeSingleResponse.apply(this,arguments)},normalizeSingleResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!0)},normalizeArrayResponse:function(e,t,r,i,a){return this._normalizeResponse(e,t,r,i,a,!1)},_normalizeResponse:function(e,t,r,i,a,n){var o={data:null,included:[]},s=this.extractMeta(e,t,r);if(s&&(o.meta=s),n){var d=this.normalize(t,r),u=d.data,c=d.included;o.data=u,c&&(o.included=c)}else{for(var h=new Array(r.length),p=0,f=r.length;p<f;p++){var m=r[p],y=this.normalize(t,m),v=y.data,b=y.included;if(b){var _;(_=o.included).push.apply(_,l(b))}h[p]=v}o.data=h}return o},normalize:function(e,r){var i=null;return r&&(this.normalizeUsingDeclaredMapping(e,r),"object"===t.default.typeOf(r.links)&&this.normalizeUsingDeclaredMapping(e,r.links),i={id:this.extractId(e,r),type:e.modelName,attributes:this.extractAttributes(e,r),relationships:this.extractRelationships(e,r)},this.applyTransforms(e,i.attributes)),{data:i}},extractId:function(e,t){var r=u(this,"primaryKey"),i=t[r];return(0,a.default)(i)},extractAttributes:function(e,t){var r=this,i=void 0,a={};return e.eachAttribute(function(e){i=r.keyForAttribute(e,"deserialize"),void 0!==t[i]&&(a[e]=t[i])}),a},extractRelationship:function(e,r){if(t.default.isNone(r))return null;if("object"===t.default.typeOf(r)){r.id&&(r.id=(0,a.default)(r.id));var i=this.store.modelFor(e);if(r.type&&!(0,o.modelHasAttributeOrRelationshipNamedType)(i))if((0,s.default)("ds-payload-type-hooks")){var n=this.modelNameFromPayloadType(r.type),d=this.modelNameFromPayloadKey(r.type);n!==d&&this._hasCustomModelNameFromPayloadKey()&&(n=d),r.type=n}else r.type=this.modelNameFromPayloadKey(r.type);return r}return{id:(0,a.default)(r),type:e}},extractPolymorphicRelationship:function(e,t,r){return this.extractRelationship(e,t)},extractRelationships:function(e,r){var i=this,a={};return e.eachRelationship(function(e,n){var o=null,s=i.keyForRelationship(e,n.kind,"deserialize");if(void 0!==r[s]){var d=null,l=r[s];if("belongsTo"===n.kind)d=n.options.polymorphic?i.extractPolymorphicRelationship(n.type,l,{key:e,resourceHash:r,relationshipMeta:n}):i.extractRelationship(n.type,l);else if("hasMany"===n.kind&&!t.default.isNone(l)){d=new Array(l.length);for(var u=0,c=l.length;u<c;u++){var h=l[u];d[u]=i.extractRelationship(n.type,h)}}o={data:d}}var p=i.keyForLink(e,n.kind);if(r.links&&void 0!==r.links[p]){var f=r.links[p];o=o||{},o.links={related:f}}o&&(a[e]=o)}),a},modelNameFromPayloadKey:function(e){return(0,n.default)(e)},normalizeRelationships:function(e,t){var r=this,i=void 0;this.keyForRelationship&&e.eachRelationship(function(e,a){i=r.keyForRelationship(e,a.kind,"deserialize"),e!==i&&void 0!==t[i]&&(t[e]=t[i],delete t[i])})},normalizeUsingDeclaredMapping:function(e,t){var r=u(this,"attrs"),i=void 0,a=void 0;if(r)for(var n in r)i=a=this._getMappedKey(n,e),void 0!==t[a]&&(u(e,"attributes").has(n)&&(i=this.keyForAttribute(n)),u(e,"relationshipsByName").has(n)&&(i=this.keyForRelationship(n)),a!==i&&(t[i]=t[a],delete t[a]))},_getMappedKey:function(e,t){var r=u(this,"attrs"),i=void 0;return r&&r[e]&&(i=r[e],i.key&&(i=i.key),"string"==typeof i&&(e=i)),e},_canSerialize:function(e){var t=u(this,"attrs");return!t||!t[e]||!1!==t[e].serialize},_mustSerialize:function(e){var t=u(this,"attrs");return t&&t[e]&&!0===t[e].serialize},shouldSerializeHasMany:function(e,t,r){return this._shouldSerializeHasMany,p.prototype._shouldSerializeHasMany,this._shouldSerializeHasMany(e,t,r)},_shouldSerializeHasMany:function(e,t,r){var i=e.type.determineRelationshipType(r,this.store);return!!this._mustSerialize(t)||this._canSerialize(t)&&("manyToNone"===i||"manyToMany"===i)},serialize:function(e,t){var r=this,i={};if(t&&t.includeId)if((0,s.default)("ds-serialize-id"))this.serializeId(e,i,u(this,"primaryKey"));else{var a=e.id;a&&(i[u(this,"primaryKey")]=a)}return e.eachAttribute(function(t,a){r.serializeAttribute(e,i,t,a)}),e.eachRelationship(function(t,a){"belongsTo"===a.kind?r.serializeBelongsTo(e,i,a):"hasMany"===a.kind&&r.serializeHasMany(e,i,a)}),i},serializeIntoHash:function(e,t,r,i){h(e,this.serialize(r,i))},serializeAttribute:function(e,t,r,i){if(this._canSerialize(r)){var a=i.type,n=e.attr(r);if(a){n=this.transformFor(a).serialize(n,i.options)}var o=this._getMappedKey(r,e.type);o===r&&this.keyForAttribute&&(o=this.keyForAttribute(r,"serialize")),t[o]=n}},serializeBelongsTo:function(e,t,r){var i=r.key;if(this._canSerialize(i)){var a=e.belongsTo(i,{id:!0}),n=this._getMappedKey(i,e.type);n===i&&this.keyForRelationship&&(n=this.keyForRelationship(i,"belongsTo","serialize")),c(a)?t[n]=null:t[n]=a,r.options.polymorphic&&this.serializePolymorphicType(e,t,r)}},serializeHasMany:function(e,t,r){var i=r.key,a="_shouldSerializeHasMany";if(a="shouldSerializeHasMany",this[a](e,i,r)){var n=e.hasMany(i,{ids:!0});if(void 0!==n){var o=this._getMappedKey(i,e.type);o===i&&this.keyForRelationship&&(o=this.keyForRelationship(i,"hasMany","serialize")),t[o]=n}}},serializePolymorphicType:function(){},extractMeta:function(e,t,r){if(r&&void 0!==r.meta){var i=r.meta;return delete r.meta,i}},extractErrors:function(e,t,r,i){var a=this;return r&&"object"==typeof r&&r.errors&&(r=(0,d.errorsArrayToHash)(r.errors),this.normalizeUsingDeclaredMapping(t,r),t.eachAttribute(function(e){var t=a.keyForAttribute(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])}),t.eachRelationship(function(e){var t=a.keyForRelationship(e,"deserialize");t!==e&&void 0!==r[t]&&(r[e]=r[t],delete r[t])})),r},keyForAttribute:function(e,t){return e},keyForRelationship:function(e,t,r){return e},keyForLink:function(e,t){return e},transformFor:function(e,t){return(0,o.getOwner)(this).lookup("transform:"+e)}});(0,s.default)("ds-payload-type-hooks")&&p.reopen({modelNameFromPayloadType:function(e){return(0,n.default)(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==p.prototype.modelNameFromPayloadKey}}),(0,s.default)("ds-serialize-id")&&p.reopen({serializeId:function(e,t,r){var i=e.id;i&&(t[r]=i)}}),e.default=p}),t("ember-data/serializers/rest",["exports","ember","ember-inflector","ember-data/-private/debug","ember-data/serializers/json","ember-data/-private/system/normalize-model-name","ember-data/-private/system/coerce-id","ember-data/-private/utils","ember-data/-private/features"],function(e,t,r,i,a,n,o,s,d){function l(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}e.__esModule=!0;var u=t.default.String.camelize,c=a.default.extend({keyForPolymorphicType:function(e,t,r){return this.keyForRelationship(e)+"Type"},normalize:function(e,t,r){return this.normalizeHash&&this.normalizeHash[r]&&this.normalizeHash[r](t),this._super(e,t)},_normalizeArray:function(e,r,i,a){var n=this,o={data:[],included:[]},s=e.modelFor(r),d=e.serializerFor(r);return t.default.makeArray(i).forEach(function(t){var r=n._normalizePolymorphicRecord(e,t,a,s,d),i=r.data,u=r.included;if(o.data.push(i),u){var c;(c=o.included).push.apply(c,l(u))}}),o},_normalizePolymorphicRecord:function(e,t,r,i,a){var n=a,o=i;if(!(0,s.modelHasAttributeOrRelationshipNamedType)(i)&&t.type){var l=void 0;if((0,d.default)("ds-payload-type-hooks")){l=this.modelNameFromPayloadType(t.type);var u=this.modelNameFromPayloadKey(t.type);l!==u&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(l=u)}else l=this.modelNameFromPayloadKey(t.type);e._hasModelFor(l)&&(n=e.serializerFor(l),o=e.modelFor(l))}return n.normalize(o,t,r)},_normalizeResponse:function(e,r,i,a,n,s){var d=this,u={data:null,included:[]},c=this.extractMeta(e,r,i);c&&(u.meta=c);for(var h=Object.keys(i),p=0,f=h.length;p<f;p++){(function(n,c){var p=h[n],f=p,m=!1;"_"===p.charAt(0)&&(m=!0,f=p.substr(1));var y=d.modelNameFromPayloadKey(f);if(!e.modelFactoryFor(y))return"continue";var v=!m&&d.isPrimaryType(e,y,r),b=i[p];if(null===b)return"continue";if(v&&"array"!==t.default.typeOf(b)){var _=d._normalizePolymorphicRecord(e,b,p,r,d),g=_.data,R=_.included;if(u.data=g,R){var A;(A=u.included).push.apply(A,l(R))}return"continue"}var M=d._normalizeArray(e,y,b,p),F=M.data,z=M.included;if(z){var T;(T=u.included).push.apply(T,l(z))}if(s)F.forEach(function(e){var t=v&&(0,o.default)(e.id)===a;v&&!a&&!u.data||t?u.data=e:u.included.push(e)});else if(v)u.data=F;else if(F){var k;(k=u.included).push.apply(k,l(F))}})(p)}return u},isPrimaryType:function(e,t,r){return e.modelFor(t)===r},pushPayload:function(e,r){var i=this,a={data:[],included:[]};for(var n in r){(function(n){var o=i.modelNameFromPayloadKey(n);if(!e.modelFactoryFor(o))return"continue";var s=e.modelFor(o),d=e.serializerFor(s.modelName);t.default.makeArray(r[n]).forEach(function(e){var t=d.normalize(s,e,n),r=t.data,i=t.included;if(a.data.push(r),i){var o;(o=a.included).push.apply(o,l(i))}})})(n)}if((0,d.default)("ds-pushpayload-return"))return e.push(a);e.push(a)},modelNameFromPayloadKey:function(e){return(0,r.singularize)((0,n.default)(e))},serialize:function(e,t){return this._super.apply(this,arguments)},serializeIntoHash:function(e,t,r,i){e[this.payloadKeyFromModelName(t.modelName)]=this.serialize(r,i)},payloadKeyFromModelName:function(e){return u(e)},serializePolymorphicType:function(e,r,i){var a=i.key,n=this.keyForPolymorphicType(a,i.type,"serialize"),o=e.belongsTo(a);a=this.keyForAttribute?this.keyForAttribute(a,"serialize"):a,a+="Type",a!==n&&this.keyForPolymorphicType===c.prototype.keyForPolymorphicType&&(n=a),t.default.isNone(o)?r[n]=null:(0,d.default)("ds-payload-type-hooks")?r[n]=this.payloadTypeFromModelName(o.modelName):r[n]=u(o.modelName)},extractPolymorphicRelationship:function(e,t,r){var i=r.key,a=r.resourceHash,n=r.relationshipMeta,o=n.options.polymorphic,s=this.keyForPolymorphicType(i,e,"deserialize");if(o&&void 0!==a[s]&&"object"!=typeof t){if((0,d.default)("ds-payload-type-hooks")){var l=a[s],u=this.modelNameFromPayloadType(l),c=this.modelNameFromPayloadKey(l);return l!==c&&!this._hasCustomModelNameFromPayloadType()&&this._hasCustomModelNameFromPayloadKey()&&(u=c),{id:t,type:u}}return{id:t,type:this.modelNameFromPayloadKey(a[s])}}return this._super.apply(this,arguments)}});(0,d.default)("ds-payload-type-hooks")&&c.reopen({modelNameFromPayloadType:function(e){return(0,r.singularize)((0,n.default)(e))},payloadTypeFromModelName:function(e){return u(e)},_hasCustomModelNameFromPayloadKey:function(){return this.modelNameFromPayloadKey!==c.prototype.modelNameFromPayloadKey},_hasCustomModelNameFromPayloadType:function(){return this.modelNameFromPayloadType!==c.prototype.modelNameFromPayloadType},_hasCustomPayloadTypeFromModelName:function(){return this.payloadTypeFromModelName!==c.prototype.payloadTypeFromModelName},_hasCustomPayloadKeyFromModelName:function(){return this.payloadKeyFromModelName!==c.prototype.payloadKeyFromModelName}}),e.default=c}),t("ember-data/setup-container",["exports","ember-data/-private/initializers/store","ember-data/-private/initializers/transforms","ember-data/-private/initializers/store-injections","ember-data/-private/initializers/data-adapter"],function(e,t,r,i,a){function n(e){(0,a.default)(e),(0,r.default)(e),(0,i.default)(e),(0,t.default)(e)}e.__esModule=!0,e.default=n}),t("ember-data/store",["exports","ember-data/-private/system/store"],function(e,t){e.__esModule=!0,e.default=t.default}),t("ember-data/transform",["exports","ember"],function(e,t){e.__esModule=!0,e.default=t.default.Object.extend({serialize:null,deserialize:null})}),t("ember-data/version",["exports"],function(e){e.__esModule=!0,e.default="2.13.0-beta.4"}),t("ember-inflector",["module","exports","ember","ember-inflector/lib/system","ember-inflector/lib/ext/string"],function(e,r,i,a){r.__esModule=!0,r.defaultRules=r.singularize=r.pluralize=void 0,a.Inflector.defaultRules=a.defaultRules,i.default.Inflector=a.Inflector,i.default.String.pluralize=a.pluralize,i.default.String.singularize=a.singularize,r.default=a.Inflector,r.pluralize=a.pluralize,r.singularize=a.singularize,r.defaultRules=a.defaultRules,void 0!==t&&t.amd?t("ember-inflector",["exports"],function(e){return e.default=a.Inflector,e.pluralize=a.pluralize,e.singularize=a.singularize,e}):void 0!==e&&e.exports&&(e.exports=a.Inflector,a.Inflector.singularize=a.singularize,a.Inflector.pluralize=a.pluralize)}),t("ember-inflector/lib/ext/string",["ember","ember-inflector/lib/system/string"],function(e,t){(!0===e.default.EXTEND_PROTOTYPES||e.default.EXTEND_PROTOTYPES.String)&&(String.prototype.pluralize=function(){return(0,t.pluralize)(this)},String.prototype.singularize=function(){return(0,t.singularize)(this)})}),t("ember-inflector/lib/helpers/pluralize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e){var r=void 0,i=void 0;return 1===e.length?(i=e[0],(0,t.pluralize)(i)):(r=e[0],i=e[1],1!==parseFloat(r)&&(i=(0,t.pluralize)(i)),r+" "+i)})}),t("ember-inflector/lib/helpers/singularize",["exports","ember-inflector","ember-inflector/lib/utils/make-helper"],function(e,t,r){e.__esModule=!0,e.default=(0,r.default)(function(e){return(0,t.singularize)(e[0])})}),t("ember-inflector/lib/system",["exports","ember-inflector/lib/system/inflector","ember-inflector/lib/system/string","ember-inflector/lib/system/inflections"],function(e,t,r,i){e.__esModule=!0,e.defaultRules=e.pluralize=e.singularize=e.Inflector=void 0,t.default.inflector=new t.default(i.default),e.Inflector=t.default,e.singularize=r.singularize,e.pluralize=r.pluralize,e.defaultRules=i.default}),t("ember-inflector/lib/system/inflections",["exports"],function(e){e.__esModule=!0,e.default={plurals:[[/$/,"s"],[/s$/i,"s"],[/^(ax|test)is$/i,"$1es"],[/(octop|vir)us$/i,"$1i"],[/(octop|vir)i$/i,"$1i"],[/(alias|status|bonus)$/i,"$1es"],[/(bu)s$/i,"$1ses"],[/(buffal|tomat)o$/i,"$1oes"],[/([ti])um$/i,"$1a"],[/([ti])a$/i,"$1a"],[/sis$/i,"ses"],[/(?:([^f])fe|([lr])f)$/i,"$1$2ves"],[/(hive)$/i,"$1s"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/(x|ch|ss|sh)$/i,"$1es"],[/(matr|vert|ind)(?:ix|ex)$/i,"$1ices"],[/^(m|l)ouse$/i,"$1ice"],[/^(m|l)ice$/i,"$1ice"],[/^(ox)$/i,"$1en"],[/^(oxen)$/i,"$1"],[/(quiz)$/i,"$1zes"]],singular:[[/s$/i,""],[/(ss)$/i,"$1"],[/(n)ews$/i,"$1ews"],[/([ti])a$/i,"$1um"],[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)(sis|ses)$/i,"$1sis"],[/(^analy)(sis|ses)$/i,"$1sis"],[/([^f])ves$/i,"$1fe"],[/(hive)s$/i,"$1"],[/(tive)s$/i,"$1"],[/([lr])ves$/i,"$1f"],[/([^aeiouy]|qu)ies$/i,"$1y"],[/(s)eries$/i,"$1eries"],[/(m)ovies$/i,"$1ovie"],[/(x|ch|ss|sh)es$/i,"$1"],[/^(m|l)ice$/i,"$1ouse"],[/(bus)(es)?$/i,"$1"],[/(o)es$/i,"$1"],[/(shoe)s$/i,"$1"],[/(cris|test)(is|es)$/i,"$1is"],[/^(a)x[ie]s$/i,"$1xis"],[/(octop|vir)(us|i)$/i,"$1us"],[/(alias|status|bonus)(es)?$/i,"$1"],[/^(ox)en/i,"$1"],[/(vert|ind)ices$/i,"$1ex"],[/(matr)ices$/i,"$1ix"],[/(quiz)zes$/i,"$1"],[/(database)s$/i,"$1"]],irregularPairs:[["person","people"],["man","men"],["child","children"],["sex","sexes"],["move","moves"],["cow","kine"],["zombie","zombies"]],uncountable:["equipment","information","rice","money","species","series","fish","sheep","jeans","police"]}}),t("ember-inflector/lib/system/inflector",["exports","ember"],function(e,t){function r(e,t){for(var r=0,i=t.length;r<i;r++)e.uncountable[t[r].toLowerCase()]=!0}function i(e,t){for(var r,i=0,a=t.length;i<a;i++)r=t[i],e.irregular[r[0].toLowerCase()]=r[1],e.irregular[r[1].toLowerCase()]=r[1],e.irregularInverse[r[1].toLowerCase()]=r[0],e.irregularInverse[r[0].toLowerCase()]=r[0]}function a(e){e=e||{},e.uncountable=e.uncountable||n(),e.irregularPairs=e.irregularPairs||n();var t=this.rules={plurals:e.plurals||[],singular:e.singular||[],irregular:n(),irregularInverse:n(),uncountable:n()};r(t,e.uncountable),i(t,e.irregularPairs),this.enableCache()}function n(){var e=Object.create(null);return e._dict=null,delete e._dict,e}e.__esModule=!0;var o=t.default.String.capitalize,s=/^\s*$/,d=/([\w\/-]+[_\/\s-])([a-z\d]+$)/,l=/([\w\/\s-]+)([A-Z][a-z\d]*$)/,u=/[A-Z][a-z\d]*$/;if(!Object.create&&!Object.create(null).hasOwnProperty)throw new Error("This browser does not support Object.create(null), please polyfil with es5-sham: http://git.io/yBU2rg");a.prototype={enableCache:function(){this.purgeCache(),this.singularize=function(e){return this._cacheUsed=!0,this._sCache[e]||(this._sCache[e]=this._singularize(e))},this.pluralize=function(e){return this._cacheUsed=!0,this._pCache[e]||(this._pCache[e]=this._pluralize(e))}},purgeCache:function(){this._cacheUsed=!1,this._sCache=n(),this._pCache=n()},disableCache:function(){this._sCache=null,this._pCache=null,this.singularize=function(e){return this._singularize(e)},this.pluralize=function(e){return this._pluralize(e)}},plural:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.plurals.push([e,t.toLowerCase()])},singular:function(e,t){this._cacheUsed&&this.purgeCache(),this.rules.singular.push([e,t.toLowerCase()])},uncountable:function(e){this._cacheUsed&&this.purgeCache(),r(this.rules,[e.toLowerCase()])},irregular:function(e,t){this._cacheUsed&&this.purgeCache(),i(this.rules,[[e,t]])},pluralize:function(e){return this._pluralize(e)},_pluralize:function(e){return this.inflect(e,this.rules.plurals,this.rules.irregular)},singularize:function(e){return this._singularize(e)},_singularize:function(e){return this.inflect(e,this.rules.singular,this.rules.irregularInverse)},inflect:function(e,t,r){var i,a,n,c,h,p,f,m;if(p=!e||s.test(e),f=u.test(e),"",p)return e;if(n=e.toLowerCase(),c=d.exec(e)||l.exec(e),c&&(c[1],h=c[2].toLowerCase()),this.rules.uncountable[n]||this.rules.uncountable[h])return e
|
6
|
+
;for(m in r)if(n.match(m+"$"))return a=r[m],f&&r[h]&&(a=o(a),m=o(m)),e.replace(new RegExp(m,"i"),a);for(var y=t.length;y>0&&(i=t[y-1],m=i[0],!m.test(e));y--);return i=i||[],m=i[0],a=i[1],e.replace(m,a)}},e.default=a}),t("ember-inflector/lib/system/string",["exports","ember-inflector/lib/system/inflector"],function(e,t){function r(e){return t.default.inflector.pluralize(e)}function i(e){return t.default.inflector.singularize(e)}e.__esModule=!0,e.singularize=e.pluralize=void 0,e.pluralize=r,e.singularize=i}),t("ember-inflector/lib/utils/make-helper",["exports","ember"],function(e,t){function r(e){return t.default.Helper?t.default.Helper.helper(e):t.default.HTMLBars?t.default.HTMLBars.makeBoundHelper(e):t.default.Handlebars.makeBoundHelper(e)}e.__esModule=!0,e.default=r}),t("ember-load-initializers",["exports"],function(e){function t(e){var t=i(e,null,null,!0);if(!t)throw new Error(e+" must export an initializer.");var r=t.default;return r.name||(r.name=e.slice(e.lastIndexOf("/")+1)),r}function r(e,r){for(var i=0;i<r.length;i++)e.initializer(t(r[i]))}function n(e,r){for(var i=0;i<r.length;i++)e.instanceInitializer(t(r[i]))}e.__esModule=!0,e.default=function(e,t){for(var i=t+"/initializers/",o=t+"/instance-initializers/",s=[],d=[],l=Object.keys(a._eak_seen),u=0;u<l.length;u++){var c=l[u];0===c.lastIndexOf(i,0)?s.push(c):0===c.lastIndexOf(o,0)&&d.push(c)}r(e,s),n(e,d)}}),t("ember",[],function(){return{default:Ember}}),i("ember-data"),i("ember-load-initializers").default(Ember.Application,"ember-data"),function(){var e=i("ember-data/-private/global").default,t=i("ember-data").default;Object.defineProperty(e,"DS",{get:function(){return t}})}()}).call(this),function(){function e(e,t){define(e,[],function(){"use strict";return t})}"undefined"!=typeof define&&define&&define.petal&&function(){var t={"ember-data":{default:DS},"ember-data/model":{default:DS.Model},"ember-data/mixins/embedded-records":{default:DS.EmbeddedRecordsMixin},"ember-data/serializers/rest":{default:DS.RESTSerializer},"ember-data/serializers/active-model":{default:DS.ActiveModelSerializer},"ember-data/serializers/json":{default:DS.JSONSerializer},"ember-data/serializers/json-api":{default:DS.JSONAPISerializer},"ember-data/serializer":{default:DS.Serializer},"ember-data/adapters/json-api":{default:DS.JSONAPIAdapter},"ember-data/adapters/rest":{default:DS.RESTAdapter},"ember-data/adapter":{default:DS.Adapter},"ember-data/adapters/active-model":{default:DS.ActiveModelAdapter},"ember-data/store":{default:DS.Store},"ember-data/transform":{default:DS.Transform},"ember-data/attr":{default:DS.attr},"ember-data/relationships":{hasMany:DS.hasMany,belongsTo:DS.belongsTo}};for(var r in t)e(r,t[r])}()}();
|
@@ -6,7 +6,7 @@
|
|
6
6
|
* @copyright Copyright 2011-2017 Tilde Inc. and contributors.
|
7
7
|
* Portions Copyright 2011 LivingSocial Inc.
|
8
8
|
* @license Licensed under MIT license (see license.js)
|
9
|
-
* @version 2.13.0-beta.
|
9
|
+
* @version 2.13.0-beta.4
|
10
10
|
*/
|
11
11
|
|
12
12
|
var loader, define, requireModule, require, requirejs;
|
@@ -2371,7 +2371,10 @@ define("ember-data/-private/system/model/internal-model", ["exports", "ember", "
|
|
2371
2371
|
var InternalModel = function () {
|
2372
2372
|
function InternalModel(modelName, id, store, data) {
|
2373
2373
|
this.id = id;
|
2374
|
-
|
2374
|
+
|
2375
|
+
// this ensure ordered set can quickly identify this as unique
|
2376
|
+
this[_ember.default.GUID_KEY] = InternalModelReferenceId++ + 'internal-model';
|
2377
|
+
|
2375
2378
|
this.store = store;
|
2376
2379
|
this.modelName = modelName;
|
2377
2380
|
this._loadingPromise = null;
|
@@ -11075,6 +11078,8 @@ define('ember-data/-private/system/store/container-instance-cache', ['exports',
|
|
11075
11078
|
|
11076
11079
|
var ContainerInstanceCache = function () {
|
11077
11080
|
function ContainerInstanceCache(owner, store) {
|
11081
|
+
this.isDestroying = false;
|
11082
|
+
this.isDestroyed = false;
|
11078
11083
|
this._owner = owner;
|
11079
11084
|
this._store = store;
|
11080
11085
|
this._namespaces = {
|
@@ -11147,11 +11152,10 @@ define('ember-data/-private/system/store/container-instance-cache', ['exports',
|
|
11147
11152
|
};
|
11148
11153
|
|
11149
11154
|
ContainerInstanceCache.prototype.destroy = function destroy() {
|
11155
|
+
this.isDestroying = true;
|
11150
11156
|
this.destroyCache(this._namespaces.adapter);
|
11151
11157
|
this.destroyCache(this._namespaces.serializer);
|
11152
|
-
this.
|
11153
|
-
this._store = null;
|
11154
|
-
this._owner = null;
|
11158
|
+
this.isDestroyed = true;
|
11155
11159
|
};
|
11156
11160
|
|
11157
11161
|
ContainerInstanceCache.prototype.toString = function toString() {
|
@@ -16675,7 +16679,7 @@ define("ember-data/version", ["exports"], function (exports) {
|
|
16675
16679
|
"use strict";
|
16676
16680
|
|
16677
16681
|
exports.__esModule = true;
|
16678
|
-
exports.default = "2.13.0-beta.
|
16682
|
+
exports.default = "2.13.0-beta.4";
|
16679
16683
|
});
|
16680
16684
|
define("ember-inflector", ["module", "exports", "ember", "ember-inflector/lib/system", "ember-inflector/lib/ext/string"], function (module, exports, _ember, _system) {
|
16681
16685
|
"use strict";
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-data-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.13.0.beta.
|
4
|
+
version: 2.13.0.beta.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yehuda Katz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ember-source
|