PageSourceSearch

https://app.affogata.com/n/js/chunk-vendors-7291a857.932f2e27.js

js affogata.com collected 2026-10-02 06:02:31 UTC 86,789 bytes, 2 lines download raw bytes

vendor: 4,734 bytes, line 1
1(self["webpackChunkaffogata_app"]=self["webpackChunkaffogata_app"]||[]).push([[9735],{3736:function(e,t,i){"undefined"!==typeof i.g&&i.g.__pretenderNodePolyfill&&(delete i.g.self,delete i.g.__pretenderNodePolyfill)},4017:function(e,t,i){"use strict";i.d(t,{Kx:function(){return ct},YK:function(){return Ne},g4:function(){return Pt},iQ:function(){return Ot},sA:function(){return Rt}});var n=i(11331),r=i.n(n),o=i(1882),s=i.n(o),a=i(73916),c=i.n(a),u=i(63375),l=i.n(u),h=i(35970),d=i.n(h),f=i(42088),y=i(8455),m=i.n(y),p=i(2404),v=i.n(p),g=i(55378),k=i.n(g),_=i(88055),b=i.n(_),F=i(66154),A=i.n(F),w=i(83673),N=i.n(w),I=i(61448),R=i.n(I),M=i(35880),C=i.n(M),O=i(84574),P=i.n(O),z=i(58156),S=i.n(z),T=i(50014),j=i.n(T),E=i(52420),K=i.n(E),q=i(44383),x=i.n(q),D=i(86139),Y=i.n(D),H=i(7309),B=i.n(H),W=i(64846),L=i.n(W),G=(i(97083),i(98806));i(3736);function Q(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function J(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(i),!0).forEach((function(t){X(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Q(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function U(e){return U="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(e)}function $(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Z(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function V(e,t,i){return t&&Z(e.prototype,t),i&&Z(e,i),e}function X(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function ee(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ie(e,t)}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},te(e)}function ie(e,t){return ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ie(e,t)}function ne(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function re(e,t,i){return re=ne()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=Function.bind.apply(e,n),o=new r;return i&&ie(o,i.prototype),o},re.apply(null,arguments)}function oe(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e,t){if(t&&("object"===typeof t||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return oe(e)}function ae(e){var t=ne();return function(){var i,n=te(e);if(t){var r=te(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return se(this,i)}}function ce(e,t){return de(e)||ye(e,t)||me(e,t)||ge()}function ue(e){return de(e)||fe(e)||me(e)||ge()}function le(e){return he(e)||fe(e)||me(e)||ve()}function he(e){if(Array.isArray(e))return pe(e)}function de(e){if(Array.isArray(e))return e}function fe(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ye(e,t){var i=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o=[],s=!0,a=!1;try{for(i=i.call(e);!(s=(n=i.next()).done);s=!0)if(o.push(n.value),t&&o.length===t)break}catch(c){a=!0,r=c}finally{try{s||null==i["return"]||i["return"]()}finally{if(a)throw r}}return o}}function me(e,t){if(e){if("string"===typeof e)return pe(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?pe(e,t):void 0}}function pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function ve(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}
1function ge(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ke(e){var t=l()(d()(e)),i=t.length,n=new Array(i),r={},o=i,s=function o(s,a,c){if(c.indexOf(s)>=0)throw new Error("Cyclic dependency in properties ".concat(JSON.stringify(c)));if(!r[a]){r[a]=!0;var u=e.filter((function(e){return e&&e[0]===s}));if(a=u.length,a){var l=c.concat(s);do{var h=u[--a],d=h[1];d&&o(d,t.indexOf(d),l)}while(a)}n[--i]=s}};while(o--)r[o]||s(t[o],o,[]);return n.reverse()}var _e=function e(){this.build=function(t){var i=this,n={},o=Object.assign({},this.attrs);delete o.afterCreate,Object.keys(o).forEach((function(t){e.isTrait.call(i,t)&&delete o[t]}));var a=be(o,t);return a.forEach((function(e){var i,a;i=function(e){return c()(e,a)},a=function(e){return Array.isArray(e)?e.map(a):r()(e)?i(e):s()(e)?e.call(o,t):e};var u=o[e];s()(u)?n[e]=u.call(n,t):n[e]=a(u)})),n}};function be(e,t){var i,n=function(){},r=new n,o=[];return Object.keys(e).forEach((function(e){var t;Object.defineProperty(r.constructor.prototype,e,{get:function(){return o.push([i,e]),t},set:function(e){t=e},enumerable:!1,configurable:!0})})),Object.keys(e).forEach((function(t){var i=e[t];"function"!==typeof i&&(r[t]=i)})),Object.keys(e).forEach((function(n){var s=e[n];i=n,"function"===typeof s&&(r[n]=s.call(r,t)),o.push([n])})),ke(o)}function Fe(e){return(+e).toString()===e.toString()}_e.extend=function(e){var t=Object.assign({},this.attrs,e),i=function(){this.attrs=t,_e.call(this)};return i.extend=_e.extend,i.extractAfterCreateCallbacks=_e.extractAfterCreateCallbacks,i.isTrait=_e.isTrait,i.attrs=t,i},_e.extractAfterCreateCallbacks=function(){var e,t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=i.traits,r=[],o=this.attrs||{};return o.afterCreate&&r.push(o.afterCreate),e=Array.isArray(n)?n:Object.keys(o),e.filter((function(e){return t.isTrait(e)&&o[e].extension.afterCreate})).forEach((function(e){r.push(o[e].extension.afterCreate)})),r},_e.isTrait=function(e){var t=this.attrs;return r()(t[e])&&!0===t[e].__isTrait__};var Ae=function(){function e(){$(this,e),this._nextId=1,this._ids={}}return V(e,[{key:"get",value:function(){return this._nextId}},{key:"set",value:function(e){if(this._ids[e])throw new Error("Attempting to use the ID ".concat(e,", but it's already been used"));Fe(e)&&+e>=this._nextId&&(this._nextId=+e+1),this._ids[e]=!0}},{key:"inc",value:function(){var e=this.get()+1;return this._nextId=e,e}},{key:"fetch",value:function(){var e=this.get();return this._ids[e]=!0,this.inc(),e.toString()}},{key:"reset",value:function(){this._nextId=1,this._ids={}}}]),e}(),we=console.warn,Ne=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;$(this,e),this.code=t,this.headers=i,204===t?void 0!==n&&""!==n?we("Mirage: One of your route handlers is returning a custom\n          204 Response that has data, but this is a violation of the HTTP spec\n          and could lead to unexpected behavior. 204 responses should have no\n          content (an empty string) as their body."):this.data="":void 0!==n&&""!==n||Object.prototype.hasOwnProperty.call(this.headers,"Content-Type")?this.data=n:this.data={},204===t||Object.prototype.hasOwnProperty.call(this.headers,"Content-Type")||(this.headers["Content-Type"]="application/json")}return V(e,[{key:"toRackResponse",value:function(){return[this.code,this.headers,this.data]}}]),e}(),Ie={},Re={},Me={},Ce={};function Oe(e){if("string"!==typeof Ie[e]){var t=(0,f.PT)(ze(e),!1),i=t.split("/").map(m()).join("/");Ie[e]=i}return Ie[e]}function Pe(e){if("string"!==typeof Re[e]){var t=(0,f._k)(ze(e));Re[e]=t}return Re[e]}function ze(e){if("string"!==typeof Me[e]){var t=(0,f.z9)(e);Me[e]=t}return Me[e]}function Se(e){if("string"!==typeof Ce[e]){var t=(0,f.ZH)(e);Ce[e]=t}return Ce[e]}function Te(e){return r()(e)&&!0===e.__isAssociation__}var je=["description","fileName","lineNumber","message","name","number","stack"];function Ee(e,t){if("string"===typeof e&&!t)throw new Ke(e);if(!e)throw new Ke(t.replace(/^ +/gm,"")||"Assertion failed")}function Ke(e,t){var i=Error(e);t&&(i.stack=t);for(var n=0;n<je.length;n++){var r=je[n];["description","message","stack"].indexOf(r)>-1?this[r]="Mirage: ".concat(i[r]):this[r]=i[r]}}Ke.prototype=Object.create(Error.prototype);var qe=function(){function e(t,i){$(this,e),this.modelName=void 0,"object"===U(t)?(this.modelName=void 0,this.opts=t):(this.modelName=t?Pe(t):"",this.opts=i||{}),this.name="",this.ownerModelName=""}return V(e,[{key:"setSchema",value:function(e){this.schema=e}},{key:"isReflexive",value:function(){var e=!(this.modelName!==this.ownerModelName||!this.opts.inverse),t=!(void 0!==this.opts.inverse||this.ownerModelName!==this.modelName);return e||t}},{key:"isPolymorphic",get:function(){return this.opts.polymorphic}},{key:"type",get:function(){throw new Error("Subclasses of Association must implement a getter for type")}},{key:"foreignKey",get:function(){return this.getForeignKey()}},{key:"identifier",get:function(){throw new Error("Subclasses of Association must implement a getter for identifier")}}]),e}(),xe={},De=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"identifier",get:function(){if("string"!==typeof xe[this.name]){var e="".concat(Oe(this.name),"Id");xe[this.name]=e}return xe[this.name]}},{key:"type",get:function(){return"belongsTo"}},{key:"getForeignKeyArray",value:function(){return[Oe(this.ownerModelName),this.getForeignKey()]}},{key:"getForeignKey",value:function(){if("string"!==typeof xe[this.name]){var e="".concat(Oe(this.name),"Id");xe[this.name]=e}return xe[this.name]}},{key:"addMethodsToModelClass",value:function(e,t){var i=e.prototype,n=this,r=this.getForeignKey(),o=X({},t,this);i.belongsToAssociations=Object.assign(i.belongsToAssociations,o),Object.keys(i.belongsToAssociations).forEac
1h((function(e){var t=i.belongsToAssociations[e];i.belongsToAssociationFks[t.getForeignKey()]=t})),this.schema.addDependentAssociation(this,this.modelName),i.associationKeys.add(t),i.associationIdKeys.add(r),Object.defineProperty(i,r,{get:function(){this._tempAssociations=this._tempAssociations||{};var e,i=this._tempAssociations[t];return e=null===i?null:n.isPolymorphic?i?{id:i.id,type:i.modelName}:this.attrs[r]:i?i.id:this.attrs[r],e},set:function(e){var i;null===e?i=null:void 0!==e&&(n.isPolymorphic?(Ee("object"===U(e),"You're setting an ID on the polymorphic association '".concat(n.name,"' but you didn't pass in an object. Polymorphic IDs need to be in the form { type, id }.")),i=n.schema[n.schema.toCollectionName(e.type)].find(e.id)):(i=n.schema[n.schema.toCollectionName(n.modelName)].find(e),Ee(i,"Couldn't find ".concat(n.modelName," with id = ").concat(e)))),this[t]=i}}),Object.defineProperty(i,t,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=this._tempAssociations[t],i=this[r],o=null;return e?o=e:null!==i&&(o=n.isPolymorphic?n.schema[n.schema.toCollectionName(i.type)].find(i.id):n.schema[n.schema.toCollectionName(n.modelName)].find(i)),o},set:function(e){if(this._tempAssociations=this._tempAssociations||{},this._tempAssociations[t]=e,e&&e.hasInverseFor(n)){var i=e.inverseFor(n);e.associate(this,i)}}}),i["new".concat(Se(t))]=function(){var e,i;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,i=arguments.length<=0?void 0:arguments[0]);var r=n.schema[n.schema.toCollectionName(e)]["new"](i);return this[t]=r,r},i["create".concat(Se(t))]=function(){var e,i;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,i=arguments.length<=0?void 0:arguments[0]);var r=n.schema[n.schema.toCollectionName(e)].create(i);return this[t]=r,this.save(),r.reload()}}},{key:"disassociateAllDependentsFromTarget",value:function(e){var t,i=this,n=this.ownerModelName;t=this.isPolymorphic?{type:e.modelName,id:e.id}:e.id;var r=this.schema[this.schema.toCollectionName(n)].where((function(e){var n=e[i.getForeignKey()];return!!n&&("object"===U(n)?n.type===t.type&&n.id===t.id:n===t)}));r.models.forEach((function(t){t.disassociate(e,i),t.save()}))}}]),i}(qe);function Ye(e){return Array.isArray(e)?e.map(Ye):Object.assign({},e)}var He=function(){function e(t,i,n){$(this,e),this.name=t,this._records=[],this.identityManager=new n,i&&this.insert(i)}return V(e,[{key:"all",value:function(){return Ye(this._records)}},{key:"insert",value:function(e){var t=this;return Array.isArray(e)?k()(e,(function(e){return t._insertRecord(e)})):this._insertRecord(e)}},{key:"find",value:function(e){if(Array.isArray(e)){var t=this._findRecords(e).filter(Boolean).map(Ye);return t}var i=this._findRecord(e);return i?Ye(i):null}},{key:"findBy",value:function(e){var t=this._findRecordBy(e);return t?Ye(t):null}},{key:"where",value:function(e){return this._findRecordsWhere(e).map(Ye)}},{key:"firstOrCreate",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.where(e),n=ce(i,1),r=n[0];if(r)return r;var o=Object.assign(t,e),s=this.insert(o);return s}},{key:"update",value:function(e,t){var i,n=this;if("undefined"===typeof t){t=e;var r=[];return this._records.forEach((function(e){var i=Object.assign({},e);n._updateRecord(e,t),v()(i,e)||r.push(e)})),r}if("number"===typeof e||"string"===typeof e){var o=e,s=this._findRecord(o);return this._updateRecord(s,t),s}if(Array.isArray(e)){var a=e;
1return i=this._findRecords(a),i.forEach((function(e){n._updateRecord(e,t)})),i}if("object"===U(e)){var c=e;return i=this._findRecordsWhere(c),i.forEach((function(e){n._updateRecord(e,t)})),i}}},{key:"remove",value:function(e){var t,i=this;if("undefined"===typeof e)this._records=[],this.identityManager.reset();else if("number"===typeof e||"string"===typeof e){var n=this._findRecord(e),r=this._records.indexOf(n);this._records.splice(r,1)}else Array.isArray(e)?(t=this._findRecords(e),t.forEach((function(e){var t=i._records.indexOf(e);i._records.splice(t,1)}))):"object"===U(e)&&(t=this._findRecordsWhere(e),t.forEach((function(e){var t=i._records.indexOf(e);i._records.splice(t,1)})))}},{key:"_findRecord",value:function(e){return e=e.toString(),this._records.find((function(t){return t.id===e}))}},{key:"_findRecordBy",value:function(e){return this._findRecordsWhere(e)[0]}},{key:"_findRecords",value:function(e){return e.map(this._findRecord,this)}},{key:"_findRecordsWhere",value:function(e){var t=this._records;function i(t){var i=Object.keys(e);return i.every((function(i){return String(t[i])===String(e[i])}))}var n="object"===U(e)?i:e;return t.filter(n)}},{key:"_insertRecord",value:function(e){var t=Ye(e);return!t||void 0!==t.id&&null!==t.id?(t.id=t.id.toString(),this.identityManager.set(t.id)):t.id=this.identityManager.fetch(t),this._records.push(t),Ye(t)}},{key:"_updateRecord",value:function(e,t){var i=t&&Object.prototype.hasOwnProperty.call(t,"id")?t.id.toString():null,n=e.id;if(i&&n!==i)throw new Error("Updating the ID of a record is not permitted");for(var r in t)"id"!==r&&(e[r]=t[r])}}]),e}(),Be=function(){function e(t,i){$(this,e),this._collections=[],this.registerIdentityManagers(i),t&&this.loadData(t)}return V(e,[{key:"loadData",value:function(e){for(var t in e)this.createCollection(t,b()(e[t]))}},{key:"dump",value:function(){return this._collections.reduce((function(e,t){return e[t.name]=t.all(),e}),{})}},{key:"createCollection",value:function(e,t){if(this[e])t&&this[e].insert(t);else{var i=this.identityManagerFor(e),n=new He(e,t,i);Object.defineProperty(this,e,{get:function(){var e=n.all();return["insert","find","findBy","where","update","remove","firstOrCreate"].forEach((function(t){e[t]=function(){return n[t].apply(n,arguments)}})),e}}),Object.defineProperty(this,"_".concat(e),{get:function(){var e=[];return["insert","find","findBy","where","update","remove","firstOrCreate"].forEach((function(t){e[t]=function(){return n[t].apply(n,arguments)}})),e}}),this._collections.push(n)}return this}},{key:"createCollections",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];i.forEach((function(t){return e.createCollection(t)}))}},{key:"emptyData",value:function(){this._collections.forEach((function(e){return e.remove()}))}},{key:"identityManagerFor",value:function(e){return this._identityManagers[this._container.inflector.singularize(e)]||this._identityManagers.application||Ae}},{key:"registerIdentityManagers",value:function(e){this._identityManagers=e||{}}}]),e}(),We=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];$(this,e),Ee(t&&"string"===typeof t,"You must pass a `modelName` into a Collection"),this.modelName=t,this.models=i}return V(e,[{key:"length",get:function(){return this.models.length}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A().apply(void 0,[this.models,"update"].concat(t)),this}},{key:"save",value:function(){return A()(this.models,"save"),this}},{key:"reload",value:function(){return A()(this.models,"reload"),this}},{key:"destroy",value:function(){return A()(this.models,"destroy"),this}},{key:"add",value:function(e){return this.models.push(e),this}},{key:"remove",value:function(e){var t=this.models.find((function(t){return t.toString()===e.toString()}));if(t){var i=this.models.indexOf(t);this.models.splice(i,1)}return this}},{key:"includes",value:function(e){return this.models.some((function(t){return t.toString()===e.toString()}))}},{key:"filter",value:function(t){var i=this.models.filter(t);return new e(this.modelName,i)}},{key:"sort",value:function(t){var i=this.models.concat().sort(t);return new e(this.modelName,i)}},{key:"slice",value:function(){var t,i=(t=this.models).slice.apply(t,arguments);return new e(this.modelName,i)}},{key:"mergeCollection",value:function(e){return this.models=this.models.concat(e.models),this}},{key:"toString",value:function(){return"collection:".concat(this.modelName,"(").concat(this.models.map((function(e){return e.id})).join(","),")")}}]),e}(),Le=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];$(this,e),this.models=t}return V(e,[{key:"length",get:function(){return this.models.length}},{key:"update",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return A().apply(void 0,[this.models,"update"].concat(t)),this}},{key:"destroy",value:function(){return A()(this.models,"destroy"),this}},{key:"save",value:function(){return A()(this.models,"save"),this}},{key:"reload",value:function(){return A()(this.models,"reload"),this}},{key:"add",value:function(e){return this.models.push(e),this}},{key:"remove",value:function(e){var t=this.models.find((function(t){return v()(t.attrs,e.attrs)}));if(t){var i=this.models.indexOf(t);this.models.splice(i,1)}return this}},{key:"includes",value:function(e){return this.models.some((function(t){return v()(t.attrs,e.attrs)}))}},{key:"filter",value:function(t){var i=this.models.filter(t);return new e(i)}},{key:"sort",value:function(t){var i=this.models.concat().sort(t);return new e(i)}},{key:"slice",value:function(){var t,i=(t=this.models).slice.apply(t,arguments);return new e(i)}},{key:"mergeCollection",value:function(e){return this.models=this.models.concat(e.models),this}},{key:"toString",value:function(){return"collection:".concat(this.modelName,"(").concat(this.models.map((function(e){return e.id})).join(","),")")}}]),e}(),Ge={},Qe=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"identifier",get:function(){if("string"!==typeof Ge[this.name]){var e="".concat(Oe(this._container.inflector.singularize(this.name)),"Ids");Ge[this.name]=e}return Ge[this.name]}},{key:"type",get:function(){return"hasMany"}},{key:"getForeignKeyArray",value:function(){return[Oe(this.ownerModelName),this.getForeignKey()]}},{key:"getForeignKey",value:function(){if("string"!==typeof Ge[this.name]){var e="".concat(this._container.inflector.singularize(Oe(this.name)),"Ids");Ge[this.name]=e}return Ge[this.name]}},{key:"addMethodsToModelClass",value:function(e,t){var i=e.prototype,n=this,r=this.getForeignKey(),o=X({},t,this);i.hasManyAssociations=Object.assign(i.hasManyAssociations,o),Object.keys(i.hasManyAssociations).forEac
1h((function(e){var t=i.hasManyAssociations[e];i.hasManyAssociationFks[t.getForeignKey()]=t})),this.schema.addDependentAssociation(this,this.modelName),i.associationKeys.add(t),i.associationIdKeys.add(r),Object.defineProperty(i,r,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=this._tempAssociations[t],i=[];return i=e?n.isPolymorphic?e.models.map((function(e){return{type:e.modelName,id:e.id}})):e.models.map((function(e){return e.id})):this.attrs[r]||[],i},set:function(e){var i;if(null===e)i=[];else if(void 0!==e)if(Ee(Array.isArray(e),"You must pass an array in when setting ".concat(r," on ").concat(this)),n.isPolymorphic){Ee(e.every((function(e){return"object"===U(e)&&void 0!==U(e.type)&&void 0!==U(e.id)})),"You must pass in an array of polymorphic identifiers (objects of shape { type, id }) when setting ".concat(r," on ").concat(this));var o=e.map((function(e){var t=e.type,i=e.id;return n.schema[n.schema.toCollectionName(t)].find(i)}));i=new Le(o)}else i=n.schema[n.schema.toCollectionName(n.modelName)].find(e);this[t]=i}}),Object.defineProperty(i,t,{get:function(){this._tempAssociations=this._tempAssociations||{};var e=null;if(this._tempAssociations[t])e=this._tempAssociations[t];else{if(n.isPolymorphic)if(this[r]){var i=this[r],o=i.map((function(e){var t=e.type,i=e.id;return n.schema[n.schema.toCollectionName(t)].find(i)}));e=new Le(o)}else e=new Le(n.modelName);else e=this[r]?n.schema[n.schema.toCollectionName(n.modelName)].find(this[r]):new We(n.modelName);this._tempAssociations[t]=e}return e},set:function(e){var i,r=this;(e instanceof We||e instanceof Le)&&(e=e.models),e=e?N()(e):[],this._tempAssociations=this._tempAssociations||{},i=n.isPolymorphic?new Le(e):new We(n.modelName,e),this._tempAssociations[t]=i,e.forEach((function(e){if(e.hasInverseFor(n)){var t=e.inverseFor(n);e.associate(r,t)}}))}}),i["new".concat(Se(Oe(this._container.inflector.singularize(n.name))))]=function(){var e,i;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,i=arguments.length<=0?void 0:arguments[0]);var r=n.schema[n.schema.toCollectionName(e)]["new"](i),o=this[t].models;return o.push(r),this[t]=o,r},i["create".concat(Se(Oe(this._container.inflector.singularize(n.name))))]=function(){var e,i;n.isPolymorphic?(e=arguments.length<=0?void 0:arguments[0],i=arguments.length<=1?void 0:arguments[1]):(e=n.modelName,i=arguments.length<=0?void 0:arguments[0]);var r=n.schema[n.schema.toCollectionName(e)].create(i),o=this[t].models;return o.push(r),this[t]=o,this.save(),r.reload()}}},{key:"disassociateAllDependentsFromTarget",value:function(e){var t,i=this,n=this.ownerModelName;t=this.isPolymorphic?{type:e.modelName,id:e.id}:e.id;var r=this.schema[this.schema.toCollectionName(n)].where((function(e){var n=e[i.getForeignKey()];return n&&n.find((function(e){return"object"===U(e)?e.type===t.type&&e.id===t.id:e===t}))}));r.models.forEach((function(t){t.disassociate(e,i),t.save()}))}}]),i}(qe),Je={},Ue=function(){function e(){$(this,e)}return V(e,[{key:"getModelClassFromPath",value:function(e){if(e){if("string"!==typeof Je[e]){for(var t,i=e.split("/"),n=i.length-1;n>=0;n--){var r=i[n];if(r.length&&":"!==r[0]){t=r;break}}Je[e]=Pe(Oe(this._container.inflector.singularize(t)))}return Je[e]}}},{key:"_getIdForRequest",value:function(e,t){var i;return e&&e.params&&e.params.id?i=e.params.id:t&&t.data&&t.data.id&&(i=t.data.id),i}},{key:"_getJsonApiDocForRequest",value:function(e,t){var i;return e&&e.requestBody&&(i=JSON.parse(e.requestBody)),this.serializerOrRegistry.normalize(i,t)}},{key:"_getAttrsForRequest",value:function(e,t){var i=this,n=this._getJsonApiDocForRequest(e,t),r=this._getIdForRequest(e,n),o={};return Ee(n.data&&(n.data.attributes||n.data.type||n.data.relationships),"You're using a shorthand or #normalizedRequestAttrs, but your serializer's normalize function did not return a valid JSON:API document. Consult the docs for the normalize hook on the Serializer class."),n.data.attributes&&(o=Object.keys(n.data.attributes).reduce((function(e,t){return e[Oe(t)]=n.data.attributes[t],e}),{})),n.data.relationships&&Object.keys(n.data.relationships).forEac
1h((function(r){var s,a=n.data.relationships[r],c=i.schema.modelClassFor(t),u=c.associationFor(Oe(r));Ee(u,"You're passing the relationship '".concat(r,"' to the '").concat(t,"' model via a ").concat(e.method," to '").concat(e.url,"', but you did not define the '").concat(r,"' association on the '").concat(t,"' model.")),s=u.isPolymorphic?a.data:u instanceof Qe?a.data&&a.data.map((function(e){return e.id})):a.data&&a.data.id,o[u.identifier]=s}),{}),r&&(o.id=r),o}},{key:"_getAttrsForFormRequest",value:function(e){var t,i=e.requestBody,n=[];return Ee(i&&"string"===typeof i,"You're using the helper method #normalizedFormData, but the request body is empty or not a valid url encoded string."),n=i.split("&"),t=n.reduce((function(e,t){var i=t.split("="),n=ce(i,2),r=n[0],o=n[1];return e[r]=decodeURIComponent(o.replace(/\+/g," ")),e}),{}),t}}]),e}(),$e=function(e){ee(i,e);var t=ae(i);function i(e,n,r,o,s){var a;return $(this,i),a=t.call(this,s),a.schema=e,a.serializerOrRegistry=n,a.userFunction=r,a.path=o,a}return V(i,[{key:"handle",value:function(e){return this.userFunction(this.schema,e)}},{key:"setRequest",value:function(e){this.request=e}},{key:"serialize",value:function(e,t){var i;return i=t?this.serializerOrRegistry.serializerFor(t,{explicit:!0}):this.serializerOrRegistry,i.serialize(e,this.request)}},{key:"normalizedRequestAttrs",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=this.path,n=this.request,r=this.request.requestHeaders,o={};for(var s in r)o[s.toLowerCase()]=r[s];return/x-www-form-urlencoded/.test(o["content-type"])?e=this._getAttrsForFormRequest(n):(t?Ee(Pe(t)===t,"You called normalizedRequestAttrs('".concat(t,"'), but normalizedRequestAttrs was intended to be used with the dasherized version of the model type. Please change this to normalizedRequestAttrs('").concat(Pe(t),"').")):t=this.getModelClassFromPath(i),Ee(this.schema.hasModelForModelName(t),"You're using a shorthand or the #normalizedRequestAttrs helper but the detected model of '".concat(t,"' does not exist. You might need to pass in the correct modelName as the first argument to #normalizedRequestAttrs.")),e=this._getAttrsForRequest(n,t)),e}}]),i}(Ue),Ze=function(){function e(t,i,n){$(this,e),this.schema=t,this.serializerOrRegistry=i,this.object=n}return V(e,[{key:"handle",value:function(){return this.object}}]),e}(),Ve=function(e){ee(i,e);var t=ae(i);function i(e,n,r,o){var s,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};$(this,i),s=t.call(this),r=r||s.getModelClassFromPath(o),s.schema=e,s.serializerOrRegistry=n,s.shorthand=r,s.options=a;var c=Array.isArray(r)?"array":U(r);if("string"===c){var u=s.schema[s.schema.toCollectionName(r)];s.handle=function(e){return s.handleStringShorthand(e,u)}}else if("array"===c){var l=r.map((function(e){return s.schema[s.schema.toCollectionName(e)]}));s.handle=function(e){return s.handleArrayShorthand(e,l)}}return s}return i}(Ue),Xe=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"handleStringShorthand",value:function(e,t){var i=this.shorthand,n=Oe(i);Ee(t,"The route handler for ".concat(e.url," is trying to access the ").concat(n," model, but that model doesn't exist."));var r=this._getIdForRequest(e);if(r){var o=t.find(r);return o||new Ne(404)}if(this.options.coalesce){var s=this.serializerOrRegistry.getCoalescedIds(e,n);if(s)return t.find(s)}return t.all()}},{key:"handleArrayShorthand",value:function(e,t){var i=this.shorthand,n=this._getIdForRequest(e);return Ee(!n||this._container.inflector.singularize(i[0])!==i[0],"It looks like you're using the \"Single record with\n      related records\" version of the array shorthand, in addition to opting\n      in to the model layer. This shorthand was made when there was no\n      serializer layer. Now that you're using models, please ensure your\n      relationships are defined, and create a serializer for the parent\n      model, adding the relationships there."),t.map((function(e){return e.all()}))}}]),i}(Ve),et=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"handleStringShorthand",value:function(e,t){var i=this.shorthand,n=Oe(i);Ee(t,"The route handler for ".concat(e.url," is trying to access the ").concat(n," model, but that model doesn't exist."));var r=this._getAttrsForRequest(e,t.camelizedModelName);return t.create(r)}}]),i}(Ve),tt=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"handleStringShorthand",value:function(e,t){var i=this.shorthand,n=Oe(i);Ee(t,"The route handler for ".concat(e.url," is trying to access the ").concat(n," model, but that model doesn't exist."));var r=this._getIdForRequest(e),o=t.find(r);if(!o)return new Ne(404);var s=this._getAttrsForRequest(e,t.camelizedModelName);return o.update(s)}}]),i}(Ve),it=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"handleStringShorthand",value:function(e,t){var i=this.shorthand,n=Oe(i);Ee(t,"The route handler for ".concat(e.url," is trying to access the ").concat(n," model, but that model doesn't exist."));var r=this._getIdForRequest(e),o=t.find(r);if(!o)return new Ne(404);o.destroy()}},{key:"handleArrayShorthand",value:function(e,t){var i=this,n=this._getIdForRequest(e),r=t[0].find(n),o=t.slice(1).map((function(e){return i._container.inflector.pluralize(e.camelizedModelName)}));o.forEach((function(e){return r[e].destroy()})),r.destroy()}}]),i}(Ve),nt=function(e){ee(i,e);var t=ae(i);function i(){return $(this,i),t.apply(this,arguments)}return V(i,[{key:"handleStringShorthand",value:function(e,t){var i=this.shorthand,n=Oe(i);Ee(t,"The route handler for ".concat(e.url," is trying to access the ").concat(n," model, but that model doesn't exist."));var r=this._getIdForRequest(e);
1if(r){var o=t.find(r);return new Ne(o?204:404)}if(this.options.coalesce&&e.queryParams&&e.queryParams.ids){var s=t.find(e.queryParams.ids);return new Ne(s?204:404)}return new Ne(204)}}]),i}(Ve),rt={get:200,put:204,post:201,delete:204};function ot(e){var t,i=e.verb,n=e.schema,r=e.serializerOrRegistry,o=e.path,s=e.rawHandler,a=e.options,c=e.middleware,u=[n,r,s,o,a,c],l=U(s);return"function"===l?t=re($e,u):"object"===l&&s?t=re(Ze,u):"get"===i?t=re(Xe,u):"post"===i?t=re(et,u):"put"===i||"patch"===i?t=re(tt,u):"delete"===i?t=re(it,u):"head"===i&&(t=re(nt,u)),t}var st=function(){function e(t){var i=t.schema,n=t.verb,r=t.rawHandler,o=t.customizedCode,s=t.options,a=t.path,c=t.serializerOrRegistry,u=t.middleware;$(this,e),this.verb=n,this.customizedCode=o,this.serializerOrRegistry=c,this.middleware=u||[],this.handler=ot({verb:n,schema:i,path:a,serializerOrRegistry:c,rawHandler:r,options:s})}return V(e,[{key:"handle",value:function(e){var t=this;return this._getMirageResponseForRequest(e,this.middleware).then((function(i){return t.serialize(i,e)})).then((function(e){return e.toRackResponse()}))}},{key:"_getMirageResponseForRequest",value:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];try{this.handler instanceof $e&&this.handler.setRequest(e),t=this.handleWithMiddleware(e,[].concat(le(n),[function(e,t){return i.handler.handle(t)}]))}catch(o){if(o instanceof Ke)t=new Ne(500,{},o);else{var r=o.message||o;t=new Ne(500,{},{message:r,stack:"Mirage: Your ".concat(e.method," handler for the url ").concat(e.url," threw an error:\n\n").concat(o.stack||o)})}}return this._toMirageResponse(t)}},{key:"handleWithMiddleware",value:function(e,t){var i=this,n=ue(t),r=n[0],o=n.slice(1);return r(this.schema,e,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return i.handleWithMiddleware(t,o)}))}},{key:"_toMirageResponse",value:function(e){var t,i=this;return new Promise((function(n,r){Promise.resolve(e).then((function(r){if(r instanceof Ne)t=e;else{var o=i._getCodeForResponse(r);t=new Ne(o,{},r)}n(t)}))["catch"](r)}))}},{key:"_getCodeForResponse",value:function(e){var t;return this.customizedCode?t=this.customizedCode:(t=rt[this.verb],204===t&&void 0!==e&&""!==e&&(t=200)),t}},{key:"serialize",value:function(e,t){return e.data=this.serializerOrRegistry.serialize(e.data,t),e}}]),e}();function at(e,t){var i=function(t){ee(n,t);var i=ae(n);function n(){var t,r;$(this,n);for(var o=arguments.length,s=new Array(o),a=0;a<o;a++)s[a]=arguments[a];(t=i.call.apply(i,[this].concat(s)),e&&R()(e,"constructor"))&&(r=e.constructor).call.apply(r,[oe(t)].concat(s));return t}return n}(this);return Object.assign(i,this,t),e&&Object.assign(i.prototype,e),i}var ct=function(){function e(t,i,n,r){var o=this;return $(this,e),Ee(t,"A model requires a schema"),Ee(i,"A model requires a modelName"),this._schema=t,this.modelName=i,this.fks=r||[],this.attrs={},n=n||{},this.fks.forEach((function(e){o.attrs[e]=void 0!==n[e]?n[e]:null})),Object.keys(n).forEach((function(e){var t=n[e];o._validateAttr(e,t),o._setupAttr(e,t),o._setupRelationship(e,t)})),this}return V(e,[{key:"save",value:function(){var e=this._schema.toInternalCollectionName(this.modelName);return this.isNew()?(this.attrs=this._schema.db[e].insert(this.attrs),this._definePlainAttribute("id")):(this._schema.isSaving[this.toString()]=!0,this._schema.db[e].update(this.attrs.id,this.attrs)),this._saveAssociations(),this._schema.isSaving[this.toString()]=!1,this}},{key:"update",value:function(e,t){var i;return null==e||("object"===U(e)?i=e:(i={}
1)[e]=t,Object.keys(i).forEach((function(e){this.associationKeys.has(e)||this.associationIdKeys.has(e)||this._definePlainAttribute(e),this[e]=i[e]}),this),this.save()),this}},{key:"destroy",value:function(){if(this.isSaved()){this._disassociateFromDependents();var e=this._schema.toInternalCollectionName(this.modelName);this._schema.db[e].remove(this.attrs.id)}}},{key:"isNew",value:function(){var e=!1,t=void 0!==this.attrs.id&&null!==this.attrs.id;if(t){var i=this._schema.toInternalCollectionName(this.modelName),n=this._schema.db[i].find(this.attrs.id);n&&(e=!0)}return!e}},{key:"isSaved",value:function(){return!this.isNew()}},{key:"reload",value:function(){if(this.id){var e=this._schema.toInternalCollectionName(this.modelName),t=this._schema.db[e].find(this.id);Object.keys(t).filter((function(e){return"id"!==e})).forEach((function(e){this.attrs[e]=t[e]}),this)}return this._tempAssociations={},this}},{key:"toJSON",value:function(){return J({},this.attrs)}},{key:"associations",get:function(){return this._schema.associationsFor(this.modelName)}},{key:"associationFor",value:function(e){return this.associations[e]}},{key:"inverseFor",value:function(e){return this._explicitInverseFor(e)||this._implicitInverseFor(e)}},{key:"_explicitInverseFor",value:function(e){this._checkForMultipleExplicitInverses(e);var t=this._schema.associationsFor(this.modelName),i=e.opts.inverse,n=i?t[i]:null,r=n&&n.isPolymorphic,o=n&&n.modelName===e.ownerModelName,s=n&&n.opts.inverse;return s&&n.opts.inverse!==e.name&&Ee(!1,"You specified an inverse of ".concat(i," for ").concat(e.name,", but it does not match ").concat(n.modelName," ").concat(n.name,"'s inverse")),r||o?n:null}},{key:"_checkForMultipleExplicitInverses",value:function(e){var t=this._schema.associationsFor(this.modelName),i=Object.keys(t).filter((function(i){var n=t[i],r=e.ownerModelName===n.modelName,o=e.name===n.opts.inverse;return r&&o}));Ee(i.length<=1,"The ".concat(this.modelName," model has defined multiple explicit inverse associations for the ").concat(e.ownerModelName,".").concat(e.name," association."))}},{key:"_implicitInverseFor",value:function(e){var t=this,i=this._schema.associationsFor(this.modelName),n=e.ownerModelName;return C()(i).filter((function(e){return e.modelName===n})).reduce((function(i,n){var r=n.opts.inverse,o=void 0===r,s=r===e.name,a=o||s;return a&&(Ee(!i,"The ".concat(t.modelName," model has multiple possible inverse associations for the ").concat(e.ownerModelName,".").concat(e.name," association.")),i=n),i}),null)}},{key:"hasInverseFor",value:function(e){return!!this.inverseFor(e)}},{key:"alreadyAssociatedWith",value:function(t,i){var n=this[i.name];if(n&&t)return n instanceof e?n.isSaved()&&t.isSaved()?n.toString()===t.toString():n===t:n.includes(t)}},{key:"associate",value:function(e,t){if(!this.alreadyAssociatedWith(e,t)){var i=t.name;t instanceof Qe?this[i].includes(e)||this[i].add(e):this[i]=e}}},{key:"disassociate",value:function(e,t){var i=t.getForeignKey();if(t instanceof Qe){var n;if(t.isPolymorphic){var r=this[i].find((function(t){var i=t.type,n=t.id;return i===e.modelName&&n===e.id}));n=r&&this[i].indexOf(r)}else n=this[i].map((function(e){return e.toString()})).indexOf(e.id.toString());n>-1&&this.attrs[i].splice(n,1)}else this.attrs[i]=null}},{key:"isSaving",get:function(){return this._schema.isSaving[this.toString()]}},{key:"_setupAttr",value:function(e,t){var i=this.associationKeys.has(e)||this.associationIdKeys.has(e);i||(this.attrs[e]=t,this._definePlainAttribute(e))}},{key:"_definePlainAttribute",value:function(e){var t=Object.getOwnPropertyDescriptor(this,e);t&&t.get||(Object.prototype.hasOwnProperty.call(this.attrs,e)||(this.attrs[e]=null),Object.defineProperty(this,e,{get:function(){return this.attrs[e]},set:function(t){this.attrs[e]=t}}))}},{key:"_setupRelationship",value:function(e,t){var i=this.associationIdKeys.has(e)||this.fks.includes(e),n=this.associationKeys.has(e);i&&(void 0!==t&&null!==t&&this._validateForeignKeyExistsInDatabase(e,t),this.attrs[e]=t),n&&(this[e]=t)}},{key:"_validateAttr",value:function(t,i){if(this.associationKeys.has(t)){var n=this.associationFor(t),r=null===i;if(n instanceof Qe){var o=i instanceof We||i instanceof Le,s=Array.isArray(i)&&i.every((function(t){return t instanceof e}));Ee(o||s||r,"You're trying to create a ".concat(this.modelName,' model and 
1you passed in "').concat(i,'" under the ').concat(t," key, but that key is a HasMany relationship. You must pass in a Collection, PolymorphicCollection, array of Models, or null."))}else n instanceof De&&Ee(i instanceof e||r,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(i,'" under the ').concat(t," key, but that key is a BelongsTo relationship. You must pass in a Model or null."))}if(this.associationIdKeys.has(t)&&t.endsWith("Ids")){var a=Array.isArray(i),c=null===i;Ee(a||c,"You're trying to create a ".concat(this.modelName,' model and you passed in "').concat(i,'" under the ').concat(t," key, but that key is a foreign key for a HasMany relationship. You must pass in an array of ids or null."))}var u=i instanceof e||i instanceof We||i instanceof Le,l=Array.isArray(i)&&i.length&&i.every((function(t){return t instanceof e}));if(u||l){var h=i;Ee(this.associationKeys.has(t),"You're trying to create a ".concat(this.modelName," model and you passed in a ").concat(h.toString()," under the ").concat(t," key, but you haven't defined that key as an association on your model."))}}},{key:"_validateForeignKeyExistsInDatabase",value:function(e,t){var i=this;if(Array.isArray(t)){var n,r=this.hasManyAssociationFks[e];r.isPolymorphic?(n=t.map((function(e){var t=e.type,n=e.id;return i._schema.db[i._schema.toInternalCollectionName(t)].find(n)})),n=N()(n)):n=this._schema.db[this._schema.toInternalCollectionName(r.modelName)].find(t);var o=r.isPolymorphic?t.map((function(e){return"".concat(e.type,":").concat(e.id)})).join(","):t;Ee(n.length===t.length,"You're instantiating a ".concat(this.modelName," that has a ").concat(e," of ").concat(o,", but some of those records don't exist in the database."))}else{var s,a=this.belongsToAssociationFks[e];s=a.isPolymorphic?this._schema.db[this._schema.toInternalCollectionName(t.type)].find(t.id):this._schema.db[this._schema.toInternalCollectionName(a.modelName)].find(t);var c=a.isPolymorphic?"".concat(t.type,":").concat(t.id):t;Ee(s,"You're instantiating a ".concat(this.modelName," that has a ").concat(e," of ").concat(c,", but that record doesn't exist in the database."))}}},{key:"_saveAssociations",value:function(){this._saveBelongsToAssociations(),this._saveHasManyAssociations()}},{key:"_saveBelongsToAssociations",value:function(){var e=this;C()(this.belongsToAssociations).forEach((function(t){e._disassociateFromOldInverses(t),e._saveNewAssociates(t),e._associateWithNewInverses(t)}))}},{key:"_saveHasManyAssociations",value:function(){var e=this;C()(this.hasManyAssociations).forEach((function(t){e._disassociateFromOldInverses(t),e._saveNewAssociates(t),e._associateWithNewInverses(t)}))}},{key:"_disassociateFromOldInverses",value:function(e){e instanceof Qe?this._disassociateFromHasManyInverses(e):e instanceof De&&this._disassociateFromBelongsToInverse(e)}},{key:"_disassociateFromHasManyInverses",value:function(e){var t,i=this,n=e.getForeignKey(),r=this._tempAssociations&&this._tempAssociations[e.name],o=this.attrs[n];r&&o&&(t=e.isPolymorphic?o.map((function(e){var t=e.type,n=e.id;return i._schema[i._schema.toCollectionName(t)].find(n)})):this._schema[this._schema.toCollectionName(e.modelName)].find(o||[]).models,t.filter((function(t){return!t.isSaving&&!r.includes(t)&&t.hasInverseFor(e)})).forEach((function(t){var n=t.inverseFor(e);t.disassociate(i,n),t.save()})))}},{key:"_disassociateFromBelongsToInverse",value:function(e){var t,i=e.getForeignKey(),n=this._tempAssociations&&this._tempAssociations[e.name],r=this.attrs[i];if(void 0!==n&&r&&(t=e.isPolymorphic?this._schema[this._schema.toCollectionName(r.type)].find(r.i
1d):this._schema[this._schema.toCollectionName(e.modelName)].find(r),t.hasInverseFor(e))){var o=t.inverseFor(e);t.disassociate(this,o),t._updateInDb(t.attrs)}}},{key:"_disassociateFromDependents",value:function(){var e=this;this._schema.dependentAssociationsFor(this.modelName).forEach((function(t){t.disassociateAllDependentsFromTarget(e)}))}},{key:"_saveNewAssociates",value:function(e){var t=e.getForeignKey(),i=this._tempAssociations&&this._tempAssociations[e.name];if(void 0!==i){if(this.__isSavingNewChildren=!0,delete this._tempAssociations[e.name],i instanceof We)i.models.filter((function(e){return!e.isSaving})).forEach((function(e){e.save()})),this._updateInDb(X({},t,i.models.map((function(e){return e.id}))));else if(i instanceof Le)i.models.filter((function(e){return!e.isSaving})).forEach((function(e){e.save()})),this._updateInDb(X({},t,i.models.map((function(e){return{type:e.modelName,id:e.id}}))));else if(null===i)this._updateInDb(X({},t,null));else if(this.equals(i))this._updateInDb(X({},t,this.id));else if(!i.isSaving){var n;i.save(),this._syncTempAssociations(i),n=e.isPolymorphic?{id:i.id,type:i.modelName}:i.id,this._updateInDb(X({},t,n))}this.__isSavingNewChildren=!1}}},{key:"_associateWithNewInverses",value:function(t){var i=this;if(!this.__isSavingNewChildren){var n=this[t.name];n instanceof e?this._associateModelWithInverse(n,t):(n instanceof We||n instanceof Le)&&n.models.forEach((function(e){i._associateModelWithInverse(e,t)})),delete this._tempAssociations[t.name]}}},{key:"_associateModelWithInverse",value:function(e,t){var i=this;if(e.hasInverseFor(t)){var n=e.inverseFor(t),r=n.getForeignKey(),o=this.id;if(n instanceof De){var s;s=n.isPolymorphic?{type:this.modelName,id:o}:o,this._schema.db[this._schema.toInternalCollectionName(e.modelName)].update(e.id,X({},r,s))}else{var a,c,u=this._schema.db[this._schema.toInternalCollectionName(e.modelName)],l=u.find(e.id)[n.getForeignKey()]||[],h=Object.assign([],l);n.isPolymorphic?(a={type:this.modelName,id:o},c=h.some((function(e){return e.type==i.modelName&&e.id==o}))):(a=o,c=h.includes(o)),c||h.push(a),u.update(e.id,X({},r,h))}}}},{key:"_updateInDb",value:function(e){this.attrs=this._schema.db[this._schema.toInternalCollectionName(this.modelName)].update(this.attrs.id,e)}},{key:"_syncTempAssociations",value:function(e){var t=this;Object.keys(this._tempAssociations).forEach((function(i){t._tempAssociations[i]&&t._tempAssociations[i].toString()===e.toString()&&(t._tempAssociations[i]=e)}))}},{key:"toString",value:function(){var e=this.id?"(".concat(this.id,")"):"";return"model:".concat(this.modelName).concat(e)}},{key:"equals",value:function(e){return this.toString()===e.toString()}}]),e}();ct.extend=at,ct.findBelongsToAssociation=function(e){return this.prototype.belongsToAssociations[e]};var ut=function(){function e(t,i){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};$(this,e),this.registry=t,this.type=i,this.request=r,this.attrs=this.attrs||void 0,this.include=this.include||[],this.root=this.root||void 0,this.embed=this.embed||void 0,this._embedFn=s()(this.embed)?this.embed:function(){return!!n.embed},this.serializeIds=this.serializeIds||void 0,this.primaryKey=this.primaryKey||void 0}return V(e,[{key:"serialize",value:function(e){return this.primaryResource=e,this.buildPayload(e)}},{key:"normalize",value:function(e){return e}},{key:"buildPayload",value:function(e,t,i,n){if(!e&&P()(t))return n;if(e){var r=this.getHashForPrimaryResource(e),o=ce(r,2),s=o[0],a=o[1],c=this.isCollection(e)?e.models:[e];return this.buildPayload(void 0,a,c,s)}var u=t.shift(),l=this.getHashForIncludedResource(u),h=ce(l,2),d=h[0],f=h[1],y=f.filter((function(e){return!i.map((function(e){return e.toString()})).includes(e.toString())})).concat(t),m=(this.isCollection(u)?u.models:[u]).concat(i),p=this.mergePayloads(n,d);return this.buildPayload(void 0,y,m,p)}},{key:"getHashForPrimaryResource",value:function(e){var t,i=this.getHashForResource(e),n=ce(i,2),r=n[0],o=n[1];if(this.root){Ee(!(e instanceof Le),"The base Serializer class cannot serialize a top-level PolymorphicCollection when root is true, since PolymorphicCollections have no type.");var s=this.serializerFor(e.modelName),a=s.keyForResource(e);t=X({},a,r)}else t=r;return[t,o]}},{key:"getHashForIncludedResource",value:function(e){var t,i;if(e instanceof Le)t={},i=e.models;else{var n=this.serializerFor(e.modelName),r=n.getHashForResource(e),o=ce(r,2),s=o[0],a=o[1],c=n.keyForRelationship(e.modelName);t=Array.isArray(s)?X({},c,s):X({},c,[s]),i=a}return[t,i]}},{key:"getHashForResource",value:function(e){var t,i=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=this;o&&e.modelName&&(s=this.serializerFor(e.modelName)),t=this.isModel(e)?s._hashForModel(e,n,r):e.models.map((function(e){var t=s;return t||(t=i.serializerFor(e.modelName)),t._hashForModel(e,n,r)}));
1var a=j()(N()(d()(s.getKeysForIncluded().map((function(t){return i.isCollection(e)?e.models.map((function(e){return e[t]})):e[t]})))),(function(e){return e.toString()}));return[t,a]}},{key:"mergePayloads",value:function(e,t){var i,n=Object.keys(t),r=ce(n,1),o=r[0];return e[o]?(i=e,i[o]=e[o].concat(t[o])):i=Object.assign(e,t),i}},{key:"keyForResource",value:function(e){var t=e.modelName;return this.isModel(e)?this.keyForModel(t):this.keyForCollection(t)}},{key:"keyForModel",value:function(e){return Oe(e)}},{key:"keyForCollection",value:function(e){return this._container.inflector.pluralize(this.keyForModel(e))}},{key:"_hashForModel",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this._attrsForModel(e);if(t&&e.fks.forEach((function(e){delete r[e]})),this.embed){var o=Object.assign({},n);o[e.modelName]=o[e.modelName]||{},o[e.modelName][e.id]=!0,this.getKeysForEmbedded().forEach((function(t){var n=e[t];if(n&&!S()(o,"".concat(n.modelName,".").concat(n.id))){var s=i.getHashForResource(n,!0,o,!0),a=ce(s,1),c=a[0],u=i.keyForEmbeddedRelationship(t);if(r[u]=c,i.isModel(n)){var l="".concat(Oe(t),"Id");delete r[l]}}}))}return this._maybeAddAssociationIds(e,r)}},{key:"_attrsForModel",value:function(e){var t={};return t=this.attrs?this.attrs.reduce((function(t,i){return t[i]=e[i],t}),{}):Object.assign(t,e.attrs),e.fks.forEach((function(e){return delete t[e]})),this._formatAttributeKeys(t)}},{key:"_maybeAddAssociationIds",value:function(e,t){var i=this,n=Object.assign({},t);return"always"===this.serializeIds?le(e.associationKeys).filter((function(e){return!i._embedFn(e)})).forEach((function(t){var r=e[t],o=e.associationFor(t);if(i.isCollection(r)){var s=i.keyForRelationshipIds(t);n[s]=e["".concat(i._container.inflector.singularize(t),"Ids")]}else if(i.isModel(r)&&o.isPolymorphic){var a=i.keyForPolymorphicForeignKeyType(t),c=i.keyForPolymorphicForeignKeyId(t);n[a]=e["".concat(t,"Id")].type,n[c]=e["".concat(t,"Id")].id}else if(r){var u=i.keyForForeignKey(t);n[u]=e["".concat(t,"Id")]}})):"included"===this.serializeIds&&this.getKeysForIncluded().forEach((function(t){var r=e[t],o=e.associationFor(t);if(i.isCollection(r)){var s=i.keyForRelationshipIds(t);n[s]=e["".concat(i._container.inflector.singularize(t),"Ids")]}else if(i.isModel(r)&&o.isPolymorphic){var a=i.keyForPolymorphicForeignKeyType(t),c=i.keyForPolymorphicForeignKeyId(t);n[a]=e["".concat(t,"Id")].type,n[c]=e["".concat(t,"Id")].id}else if(i.isModel(r)){var u=i.keyForForeignKey(t);n[u]=e["".concat(t,"Id")]}})),n}},{key:"keyForAttribute",value:function(e){return"id"===e?this.keyForId():e}},{key:"keyForRelationship",value:function(e){return Oe(this._container.inflector.pluralize(e))}},{key:"keyForEmbeddedRelationship",value:function(e){return Oe(e)}},{key:"keyForRelationshipIds",value:function(e){return"".concat(this._container.inflector.singularize(Oe(e)),"Ids")}},{key:"keyForForeignKey",value:function(e){return"".concat(Oe(e),"Id")}},{key:"keyForPolymorphicForeignKeyId",value:function(e){return"".concat(Oe(e),"Id")}},{key:"keyForPolymorphicForeignKeyType",value:function(e){return"".concat(Oe(e),"Type")}},{key:"isModel",value:function(e){return e instanceof ct}},{key:"isCollection",value:function(e){return e instanceof We||e instanceof Le}},{key:"isModelOrCollection",value:function(e){return this.isModel(e)||this.isCollection(e)}},{key:"serializerFor",value:function(e){return this.registry.serializerFor(e)}},{key:"getAssociationKeys",value:function(){return s()(this.include)?this.include(this.request,this.primaryResource):this.include}},{key:"getKeysForEmbedded",value:function(){var e=this;return this.getAssociationKeys().filter((function(t){return e._embedFn(t)}))}},{key:"getKeysForIncluded",value:function(){var e=this;return this.getAssociationKeys().filter((function(t){return!e._embedFn(t)}))}},{key:"schema",get:function(){return this.registry.schema}},{key:"keyForId",value:function(){return this.primaryKey}},{key:"valueForId",value:function(e){return e}},{key:"_formatAttributeKeys",value:function(e){var t={};for(var i in e){var n=e[i];"id"===i&&(n=this.valueForId(n));var r=this.keyForAttribute(i);t[r]=n}return t}}
1,{key:"getCoalescedIds",value:function(){}}]),e}();ut.prototype.include=[],ut.prototype.root=!0,ut.prototype.embed=!1,ut.prototype.primaryKey="id",ut.prototype.serializeIds="included",ut.extend=at;var lt=function(e){ee(i,e);var t=ae(i);function i(){var e;return $(this,i),e=t.apply(this,arguments),e.alwaysIncludeLinkageData=e.alwaysIncludeLinkageData||void 0,e}return V(i,[{key:"keyForModel",value:function(e){return Pe(e)}},{key:"keyForCollection",value:function(e){return Pe(e)}},{key:"keyForAttribute",value:function(e){return Pe(e)}},{key:"keyForRelationship",value:function(e){return Pe(e)}},{key:"links",value:function(){}},{key:"getHashForPrimaryResource",value:function(e){this._createRequestedIncludesGraph(e);var t=this.getHashForResource(e),i={data:t},n=this.getAddToIncludesForResource(e);return[i,n]}},{key:"getHashForIncludedResource",value:function(e){var t=this.serializerFor(e.modelName),i=t.getHashForResource(e),n={included:this.isModel(e)?[i]:i},r=[];return this.hasQueryParamIncludes()||(r=this.getAddToIncludesForResource(e)),[n,r]}},{key:"getHashForResource",value:function(e){var t,i=this;return t=this.isModel(e)?this.getResourceObjectForModel(e):e.models.map((function(e){return i.getResourceObjectForModel(e)})),t}},{key:"getAddToIncludesForResource",value:function(e){var t;if(this.hasQueryParamIncludes())t=this.getQueryParamIncludes();else{var i=this.serializerFor(e.modelName);
1t=i.getKeysForIncluded()}return this.getAddToIncludesForResourceAndPaths(e,t)}},{key:"getAddToIncludesForResourceAndPaths",value:function(e,t){var i=this,n=[];return t.forEach((function(t){var r=t.split("."),o=i.getIncludesForResourceAndPath.apply(i,[e].concat(le(r)));n.push(o)})),j()(N()(d()(n)),(function(e){return e.toString()}))}},{key:"getIncludesForResourceAndPath",value:function(e){for(var t=this,i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];var o=Oe(n.shift()),s=[],a=[];if(this.isModel(e)){var c=e[o];this.isModel(c)?a=[c]:this.isCollection(c)&&(a=c.models)}else e.models.forEach((function(e){var i=e[o];t.isModel(i)?a.push(i):t.isCollection(i)&&(a=a.concat(i.models))}));return s=s.concat(a),n.length&&a.forEach((function(e){s=s.concat(t.getIncludesForResourceAndPath.apply(t,[e].concat(n)))})),s}},{key:"getResourceObjectForModel",value:function(e){var t=this._attrsForModel(e,!0);delete t.id;var i={type:this.typeKeyForModel(e),id:e.id,attributes:t};return this._maybeAddRelationshipsToResourceObjectForModel(i,e)}},{key:"_maybeAddRelationshipsToResourceObjectForModel",value:function(e,t){var i=this,n={};return t.associationKeys.forEach((function(e){var r=t[e],o=i.keyForRelationship(e),s={};if(i.hasLinksForRelationship(t,e)){var a=i.serializerFor(t.modelName),c=a.links(t);s.links=c[e]}if(i.alwaysIncludeLinkageData||i.shouldIncludeLinkageData(e,t)||i._relationshipIsIncludedForModel(e,t)){var u=null;i.isModel(r)?u={type:i.typeKeyForModel(r),id:r.id}:i.isCollection(r)&&(u=r.models.map((function(e){return{type:i.typeKeyForModel(e),id:e.id}}))),s.data=u}P()(s)||(n[o]=s)})),P()(n)||(e.relationships=n),e}},{key:"hasLinksForRelationship",value:function(e,t){var i=this.serializerFor(e.modelName),n=i.links&&i.links(e);return n&&null!=n[t]}},{key:"_relationshipIsIncludedForModel",value:function(e,t){if(this.hasQueryParamIncludes()){var i,n=this.request._includesGraph,r=this._graphKeyForModel(t);return n.data[r]?i=n.data[r]:n.included[this._container.inflector.pluralize(t.modelName)]&&(i=n.included[this._container.inflector.pluralize(t.modelName)][r]),i&&i.relationships&&Object.prototype.hasOwnProperty.call(i.relationships,Pe(e))}var o=this.getKeysForIncluded();return o.includes(e)}},{key:"_createRequestedIncludesGraph",value:function(e){var t=this,i={data:{}};if(this.isModel(e)){var n=this._graphKeyForModel(e);i.data[n]={},this._addPrimaryModelToRequestedIncludesGraph(i,e)}else this.isCollection(e)&&e.models.forEach((function(e){var n=t._graphKeyForModel(e);i.data[n]={},t._addPrimaryModelToRequestedIncludesGraph(i,e)}));this.request._includesGraph=i}},{key:"_addPrimaryModelToRequestedIncludesGraph",value:function(e,t){var i=this;if(this.hasQueryParamIncludes()){var n=this._graphKeyForModel(t);this.getQueryParamIncludes().filter((function(e){return!!e.trim()})).forEach((function(r){e.data[n].relationships=e.data[n].relationships||{};var o=r.split(".").map(Pe),s=o[0],a=s,c=Oe(s),u=t.associationKeys.has(c);Ee(u,'You tried to include "'.concat(s,'" with ').concat(t,' but no association named "').concat(c,'" is defined on the model.'));var l,h=t[c];l=i.isModel(h)?i._graphKeyForModel(h):i.isCollection(h)?h.models.map(i._graphKeyForModel):null,e.data[n].relationships[a]=l,h&&i._addResourceToRequestedIncludesGraph(e,h,o.slice(1))}))}}},{key:"_addResourceToRequestedIncludesGraph",value:function(e,t,i){var n=this;e.included=e.included||{};var r=this.isCollection(t)?t.models:[t];r.forEach((function(t){var r=n._container.inflector.pluralize(t.modelName);e.included[r]=e.included[r]||{},n._addModelToRequestedIncludesGraph(e,t,i)}))}},{key:"_addModelToRequestedIncludesGraph",value:function(e,t,i){var n=this._container.inflector.pluralize(t.modelName),r=this._graphKeyForModel(t);e.included[n][r]=e.included[n][r]||{},i.length&&this._addResourceRelationshipsToRequestedIncludesGraph(e,n,r,t,i)}},{key:"_addResourceRelationshipsToRequestedIncludesGraph",value:function(e,t,i,n,r){e.included[t][i].relationships=e.included[t][i].relationships||{};var o,s=r[0],a=n[Oe(s)];this.isModel(a)?o=this._graphKeyForModel(a):this.isCollection(a)&&(o=a.models.map(this._graphKeyForModel)),e.included[t][i].relationships[s]=o,a&&this._addResourceToRequestedIncludesGraph(e,a,r.slice(1))}},{key:"_graphKeyForModel",value:function(e){return"".concat(e.modelName,":").concat(e.id)}},{key:"getQueryParamIncludes",value:function(){var e=S()(this,"request.queryParams.include");return e&&!Array.isArray(e)&&(e=e.split(",")),e}},{key:"hasQueryParamIncludes",value:function(){return!!this.getQueryParamIncludes()}},{key:"typeKeyForModel",value:function(e){return Pe(this._container.inflector.pluralize(e.modelName))}}
1,{key:"getCoalescedIds",value:function(e){var t=e.queryParams&&e.queryParams["filter[id]"];return"string"===typeof t?t.split(","):t}},{key:"shouldIncludeLinkageData",value:function(e,t){return!1}}]),i}(ut);lt.prototype.alwaysIncludeLinkageData=!1;var ht=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$(this,e),this.schema=t,this._serializerMap=i}return V(e,[{key:"normalize",value:function(e,t){return this.serializerFor(t).normalize(e)}},{key:"serialize",value:function(e,t){var i=this;if(this.request=t,this._isModelOrCollection(e)){var n=this.serializerFor(e.modelName);return n.serialize(e,t)}return Array.isArray(e)&&e.some(this._isCollection)?e.reduce((function(e,n){var r=i.serializerFor(n.modelName);return r.embed?e[i._container.inflector.pluralize(n.modelName)]=r.serialize(n,t):e=Object.assign(e,r.serialize(n,t)),e}),{}):e}},{key:"serializerFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.explicit,n=void 0!==i&&i,r=e&&this._serializerMap&&this._serializerMap[Oe(e)];return n?Ee(!!r,"You passed in ".concat(e," as an explicit serializer type but that serializer doesn't exist.")):(r=r||this._serializerMap.application||ut,Ee(!r||r.prototype.embed||r.prototype.root||new r instanceof lt,"You cannot have a serializer that sideloads (embed: false) and disables the root (root: false).")),new r(this,e,this.request)}},{key:"_isModel",value:function(e){return e instanceof ct}},{key:"_isCollection",value:function(e){return e instanceof We||e instanceof Le}},{key:"_isModelOrCollection",value:function(e){return this._isModel(e)||this._isCollection(e)}},{key:"registerSerializers",value:function(e){var t=this._serializerMap||{};this._serializerMap=Object.assign(t,e)}},{key:"getCoalescedIds",value:function(e,t){return this.serializerFor(t).getCoalescedIds(e)}}]),e}(),dt={},ft={},yt={},mt=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$(this,e),Ee(t,"A schema requires a db"),this.db=t,this._registry={},this._dependentAssociations={polymorphic:[]},this.registerModels(i),this.isSaving={}}return V(e,[{key:"registerModels",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};K()(t,(function(i,n){e.registerModel(n,t[n])}))}},{key:"registerModel",value:function(e,t){var i=this,n=Oe(e),r=Pe(n);t=t.extend(),this._registry[n]=this._registry[n]||{class:null,foreignKeys:[]},this._registry[n]["class"]=t,t.prototype._schema=this,t.prototype.modelName=r,t.prototype.hasManyAssociations={},t.prototype.hasManyAssociationFks={},t.prototype.belongsToAssociations={},t.prototype.belongsToAssociationFks={},t.prototype.associationKeys=new Set,t.prototype.associationIdKeys=new Set,t.prototype.depen
1dentAssociations=[];var o={};for(var s in t.prototype)if(t.prototype[s]instanceof qe){var a=t.prototype[s];a.name=s,a.modelName=a.modelName||this.toModelName(s),a.ownerModelName=r,a.setSchema(this);var c=a.getForeignKeyArray(),u=ce(c,2),l=u[0],h=u[1];o[l]=o[l]||[],Ee(!o[l].includes(h),"Your '".concat(e,"' model definition has multiple possible inverse relationships of type '").concat(l,"'. Please use explicit inverses.")),o[l].push(h),this._addForeignKeyToRegistry(l,h),a.addMethodsToModelClass(t,s)}var d=this.toCollectionName(r);return this.db[d]||this.db.createCollection(d),this[d]={camelizedModelName:n,new:function(e){return i["new"](n,e)},create:function(e){return i.create(n,e)},all:function(e){return i.all(n,e)},find:function(e){return i.find(n,e)},findBy:function(e){return i.findBy(n,e)},findOrCreateBy:function(e){return i.findOrCreateBy(n,e)},where:function(e){return i.where(n,e)},none:function(e){return i.none(n,e)},first:function(e){return i.first(n,e)}},this}},{key:"modelFor",value:function(e){return this._registry[e]}},{key:"new",value:function(e,t){return this._instantiateModel(Pe(e),t)}},{key:"create",value:function(e,t){return this["new"](e,t).save()}},{key:"all",value:function(e){var t=this.collectionForType(e);return this._hydrate(t,Pe(e))}},{key:"none",value:function(e){return this._hydrate([],Pe(e))}},{key:"find",value:function(e,t){var i=this.collectionForType(e),n=i.find(t);return Array.isArray(t)&&Ee(n.length===t.length,"Couldn't find all ".concat(this._container.inflector.pluralize(e)," with ids: (").concat(t.join(","),") (found ").concat(n.length," results, but was looking for ").concat(t.length,")")),this._hydrate(n,Pe(e))}},{key:"findBy",value:function(e,t){var i=this.collectionForType(e),n=i.findBy(t);return this._hydrate(n,Pe(e))}},{key:"findOrCreateBy",value:function(e,t){var i,n=this.collectionForType(e),r=n.findBy(t);return i=r?this._hydrate(r,Pe(e)):this.create(e,t),i}},{key:"where",value:function(e,t){var i=this.collectionForType(e),n=i.where(t);return this._hydrate(n,Pe(e))}},{key:"first",value:function(e){var t=this.collectionForType(e),i=t[0];return this._hydrate(i,Pe(e))}},{key:"modelClassFor",value:function(e){var t=this._registry[Oe(e)];return Ee(t,"Model not registered: ".concat(e)),t["class"].prototype}},{key:"addDependentAssociation",value:function(e,t){e.isPolymorphic?this._dependentAssociations.polymorphic.push(e):(this._dependentAssociations[t]=this._dependentAssociations[t]||[],this._dependentAssociations[t].push(e))}},{key:"dependentAssociationsFor",value:function(e){var t=this._dependentAssociations[e]||[],i=this._dependentAssociations.polymorphic||[];return t.concat(i)}},{key:"associationsFor",value:function(e){var t=this.modelClassFor(e);return Object.assign({},t.belongsToAssociations,t.hasManyAssociations)}},{key:"hasModelForModelName",value:function(e){return this.modelFor(Oe(e))}},{key:"collectionForType",value:function(e){var t=this.toCollectionName(e);return Ee(this.db[t],"You're trying to find model(s) of type ".concat(e," but this collection doesn't exist in the database.")),this.db[t]}},{key:"toCollectionName",value:function(e){if("string"!==typeof dt[e]){var t=Pe(e),i=Oe(this._container.inflector.pluralize(t));dt[e]=i}return dt[e]}},{key:"toInternalCollectionName",value:function(e){if("string"!==typeof ft[e]){var t="_".concat(this.toCollectionName(e));ft[e]=t}return ft[e]}},{key:"toModelName",value:function(e){if("string"!==typeof yt[e]){var t=Pe(e),i=this._container.inflector.singularize(t);yt[e]=i}return yt[e]}},{key:"_addForeignKeyToRegistry",value:function(e,t){this._registry[e]=this._registry[e]||{class:null,foreignKeys:[]};var i=this._registry[e].foreignKeys;i.includes(t)||i.push(t)}},{key:"_instantiateModel",value:function(e,t){var i=this._modelFor(e),n=this._foreignKeysFor(e);return new i(this,e,t,n)}},{key:"_modelFor",value:function(e){return this._registry[Oe(e)]["class"]}},{key:"_foreignKeysFor",value:function(e){return this._registry[Oe(e)].foreignKeys}},{key:"_hydrate",value:function(e,t){if(Array.isArray(e)){var i=e.map((function(e){return this._instantiateModel(t,e)}),this);return new We(t,i)}return e?this._instantiateModel(t,e):null}}]),e}(),pt={Db:Be,Association:qe,RouteHandler:st,BaseRouteHandler:Ue,Serializer:ut,SerializerRegistry:ht,Sc
1hema:mt},vt={singularize:f.ES,pluralize:f.td},gt=function(){function e(){$(this,e),this.inflector=vt}return V(e,[{key:"register",value:function(e,t){this[e]=t}},{key:"create",value:function(e){var t=pt[e];t.prototype._container=this;for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];return re(t,n)}}]),e}(),kt=new gt;Be.prototype._container=kt,qe.prototype._container=kt,Ue.prototype._container=kt,st.prototype._container=kt,ut.prototype._container=kt,ht.prototype._container=kt,mt.prototype._container=kt;var _t=["http://localhost:0/chromecheckurl","http://localhost:30820/socket.io",function(e){return/.+\.hot-update.json$/.test(e.url)}],bt={coalesce:!1,timing:void 0};function Ft(e){if(!e||"object"!==U(e))return!1;for(var t=Object.keys(bt),i=Object.keys(e),n=0;n<i.length;n++){var r=i[n];if(t.indexOf(r)>-1)return!0}return!1}function At(e){var t=e.splice(-1),i=ce(t,1),n=i[0];Ft(n)?n=Y()({},bt,n):(e.push(n),n=bt);var r=2-e.length;while(r-- >0)e.push(void 0);return e.push(n),e}var wt=function(){function e(){$(this,e),X(this,"urlPrefix",void 0),X(this,"namespace",void 0),X(this,"timing",void 0),X(this,"passthroughChecks",void 0),X(this,"pretender",void 0),X(this,"mirageServer",void 0),X(this,"trackRequests",void 0)}return V(e,[{key:"create",value:function(e,t){var i=this;this.mirageServer=e,this.pretender=this._create(e,t),e.pretender=this.pretender,this.passthroughChecks=this.passthroughChecks||[],this.config(t),[["get"],["post"],["put"],["delete","del"],["patch"],["head"],["options"]].forEach((function(t){var n=ce(t,2),r=n[0],o=n[1];i[r]=function(t){for(var n,o=arguments.length,s=new Array(o>1?o-1:0),a=1;a<o;a++)s[a-1]=arguments[a];var c=At(s),u=ce(c,3),l=u[0],h=u[1],d=u[2],f=e.registerRouteHandler(r,t,l,h,d),y=i._getFullPath(t),m=void 0!==d.timing?d.timing:function(){return i.timing};return null===(n=i.pretender)||void 0===n?void 0:n[r](y,f,m)},e[r]=i[r],o&&(i[o]=i[r],e[o]=i[r])}))}},{key:"config",value:function(e){var t,i,n="undefined"===typeof e.useDefaultPassthroughs||e.useDefaultPassthroughs;n&&this._configureDefaultPassthroughs();var r=void 0!==e.trackRequests&&e.trackRequests!==this.trackRequests;Ee(!r,"You cannot modify Pretender's request tracking once the server is created"),this.timing=null!==(t=null!==(i=e.timing)&&void 0!==i?i:this.timing)&&void 0!==t?t:400,this.urlPrefix=this.urlPrefix||e.urlPrefix||"",this.namespace=this.namespace||e.namespace||""}},{key:"_configureDefaultPassthroughs",value:function(){var e=this;_t.forEach((function(t){e.passthrough(t)}))}},{key:"_create",value:function(e,t){if("undefined"!==typeof window)return this.trackRequests=t.trackRequests||!1,new G.A((function(){this.passthroughRequest=function(t,i,n){e.shouldLog()&&console.log("Mirage: Passthrough request for ".concat(t.toUpperCase()," ").concat(n.url))},this.handledRequest=function(t,i,n){if(e.shouldLog()){console.groupCollapsed("Mirage: [".concat(n.status,"] ").concat(t.toUpperCase()," ").concat(n.url));var r,o,s=n.requestBody,a=n.responseText;try{r=JSON.parse(s)}catch(c){r=s}try{o=JSON.parse(a)}catch(c){o=a}console.groupCollapsed("Response"),console.log(o),console.groupEnd(),console.groupCollapsed("Request (data)"),console.log(r),console.groupEnd(),console.groupCollapsed("Request (raw)"),console.log(n),console.groupEnd(),console.groupEnd()}};var t=this.checkPassthrough;this.checkPassthrough=function(i){var n=e.passthroughChecks.some((function(e){return e(i)}));if(n){var r=i.url.includes("?")?i.url.substr(0,i.url.indexOf("?")):i.url;this[i.method.toLowerCase()](r,this.passthrough)}return t.apply(this,arguments)},this.unhandledRequest=function(e,t){t=decodeURI(t);var i="";i=""===this.namespace?"There is no existing namespace defined. Please define one":"The existing namespace is ".concat(this.namespace),Ee("Your app tried to ".concat(e," '").concat(t,"', but there was no route defined to handle this request. Define a route for this endpoint in your routes() config. Did you forget to define a namespace? ").concat(i))}}),{trackRequests:this.trackRequests})}},{key:"passthrough",value:function(){for(var e=this,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];if("undefined"!==typeof window){var r=["get","post","put","delete","patch","options","head"],o=i[i.length-1];0===i.length?i=["/**","/"]:i.length>
11&&Array.isArray(o)&&(r=i.pop()),i.forEach((function(t){"function"===typeof t?e.passthroughChecks.push(t):r.forEach((function(i){var n=e._getFullPath(t);e.pretender[i](n,e.pretender.passthrough)}))}))}}},{key:"_getFullPath",value:function(e){e="/"===e[0]?e.slice(1):e;var t="",i=this.urlPrefix?this.urlPrefix.trim():"",n="";if(this.urlPrefix&&this.namespace&&("/"===this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(0,this.namespace.length-1).substring(1)),"/"===this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(1)),"/"!==this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(0,this.namespace.length-1)),"/"!==this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n=this.namespace)),this.namespace&&!this.urlPrefix){if("/"===this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]&&(n=this.namespace.substring(0,this.namespace.length-1)),"/"===this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n=this.namespace),"/"!==this.namespace[0]&&"/"===this.namespace[this.namespace.length-1]){var r=this.namespace.substring(0,this.namespace.length-1);n="/".concat(r)}"/"!==this.namespace[0]&&"/"!==this.namespace[this.namespace.length-1]&&(n="/".concat(this.namespace))}return this.namespace||(n=""),/^https?:\/\//.test(e)?t+=e:(i.length&&(t+="/"===i[i.length-1]?i:"".concat(i,"/")),t+=n,"/"!==t[t.length-1]&&(t+="/"),t+=e,/^https?:\/\//.test(t)||(t="/".concat(t),t=t.replace(/\/+/g,"/"))),t}},{key:"start",value:function(){}},{key:"shutdown",value:function(){this.pretender.shutdown()}}]),e}(),Nt={},It={singularize:f.ES,pluralize:f.td};function Rt(e){return new Mt(e)}var Mt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(this,e),this._container=new gt,this.config(t),this.db=this.db||void 0,this.schema=this.schema||void 0,this.middleware=[]}return V(e,[{key:"namespace",get:function(){return this.interceptor.namespace},set:function(e){this.interceptor.namespace=e}},{key:"urlPrefix",get:function(){return this.interceptor.urlPrefix},set:function(e){this.interceptor.urlPrefix=e}},{key:"timing",get:function(){return this.interceptor.timing},set:function(e){this.interceptor.timing=e}},{key:"passthroughChecks",get:function(){return this.interceptor.passthroughChecks},set:function(e){this.interceptor.passthroughChecks=e}},{key:"config",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i.interceptor||(i.interceptor=new wt),this.interceptor?this.interceptor.config(i):(this.interceptor=i.interceptor,this.interceptor.create(this,i));var n=i.environment&&this.environment&&this.environment!==i.environment;Ee(!n,"You cannot modify Mirage's environment once the server is created"),this.environment=i.environment||this.environment||"development",i.routes&&(Ee(!i.baseConfig,"The routes option is an alias for the baseConfig option. You can't pass both options into your server definition."),i.baseConfig=i.routes),i.seeds&&(Ee(!i.scenarios,"The seeds option is an alias for the scenarios.default option. You can't pass both options into your server definition."),i.scenarios={default:i.seeds}),this._config=i,this.inflector=i.inflector||It,this._container.register("inflector",this.inflector),this.logging=void 0!==i.logging?this.logging:void 0,this.testConfig=this.testConfig||void 0,this.trackRequests=i.trackRequests,this.db?this.db.registerIdentityManagers(i.identityManagers):this.db=this._container.create("Db",void 0,i.identityManagers),this.schema?(this.schema.registerModels(i.models),this.serializerOrRegistry.registerSerializers(i.serializers||{})):(this.schema=this._container.create("Schema",this.db,i.models),this.serializerOrRegistry=this._container.create("SerializerRegistry",this.schema,i.serializers));var r=this._hasModulesOfType(i,"factories"),o=i.scenarios&&Object.prototype.hasOwnProperty.call(i.scenarios,"default");i.baseConfig&&this.loadConfig(i.baseConfig),this.isTest()&&(this.loadConfig(i.testConfig),"undefined"!==typeof window&&(window.server=this)),this.isTest()&&r?this.loadFactories(i.factories):!this.isTest()&&o?(this.loadFactories(i.factories),i.scenarios["default"](this)):this.loadFixtures(),null===(e=(t=this.interceptor).start)||void 0===e||e.call(t)}},{key:"isTest",value:function(){return"test"===this.environment}},{key:"shouldLog",value:function(){return"undefined"!==typeof this.logging?this.logging:!this.isTest()}},{key:"loadConfig",value:function(e){null===e||void 0===e||e.call(this),this.timing=this.isTest()?0:this.timing||0}},{key:"passthrough",value:function(){for(var e,t,i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];null===(e=(t=this.interceptor).passthrough)||void 0===e||e.call.apply(e,[t].concat(n))}},{key:"loadFixtures",value:function(){for(var e=this._config.fixtures,t=arguments.length,i=new Array(t),n=0;n<t;n++)i[n]=arguments[n];if(i.length){var r=i.map(Oe),o=r.filter((function(t){return!e[t]}));if(o.length)throw new Error("Fixtures not found: ".concat(o.join(", ")));e=x().apply(void 0,[e].concat(le(r)))}this.db.loadData(e)}},{key:"loadFactories",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this._factoryMap||{};this._factoryMap=Y()(i,t),Object.keys(t).forEach((function(t){var i=e.schema.toCollectionName(t);e.db.createCollection(i)}))}},{key:"factoryFor",value:function(e){var t=Oe(e);if(this._factoryMap&&this._factoryMap[t])return this._factoryMap[t]}},{key:"build",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];var o=i.filter((function(e){return e&&"string"===typeof e})),s=B()(i,(function(e){return r()(e)})),a=Oe(e);this.factorySequences=this.factorySequences||{},this.factorySequences[a]=this.factorySequences[a]+1||0;var c=this.factoryFor(e);if(c){c=c.extend({});var u=c.attrs||{};
1this._validateTraits(o,c,e);var l=this._mergeExtensions(u,o,s);this._mapAssociationsFromAttributes(e,u,s),this._mapAssociationsFromAttributes(e,l);var h=c.extend(l),d=new h,f=this.factorySequences[a];return d.build(f)}return s}},{key:"buildList",value:function(e,t){Ee(L()(t),"second argument has to be an integer, you passed: ".concat(U(t)));for(var i=[],n=arguments.length,r=new Array(n>2?n-2:0),o=2;o<n;o++)r[o-2]=arguments[o];for(var s=[e].concat(r),a=0;a<t;a++)i.push(this.build.apply(this,s));return i}},{key:"create",value:function(e){var t=this;Ee(this._modelOrFactoryExistsForType(e),"You called server.create('".concat(e,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name."));for(var i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];var s,a=n.filter((function(e){return e&&"string"===typeof e})),c=B()(n,(function(e){return r()(e)})),u=B()(n,(function(e){return e&&Array.isArray(e)})),l=this.build.apply(this,[e].concat(le(a),[c]));if(this.schema&&this.schema[this.schema.toCollectionName(e)]){var h=this.schema[this.schema.toCollectionName(e)];s=h.create(l)}else{var d,f;u?d=u:(f=this.schema?this.schema.toInternalCollectionName(e):"_".concat(this.inflector.pluralize(e)),d=this.db[f]),Ee(d,"You called server.create('".concat(e,"') but no model or factory was found.")),s=d.insert(l)}var y=this.factoryFor(e);return y&&y.extractAfterCreateCallbacks({traits:a}).forEach((function(e){e(s,t)})),s}},{key:"createList",value:function(e,t){Ee(this._modelOrFactoryExistsForType(e),"You called server.createList('".concat(e,"') but no model or factory was found. Make sure you're passing in the singularized version of the model or factory name.")),Ee(L()(t),"second argument has to be an integer, you passed: ".concat(U(t)));for(var i=[],n=this.schema?this.schema.toInternalCollectionName(e):"_".concat(this.inflector.pluralize(e)),r=this.db[n],o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];for(var c=[e].concat(s,[r]),u=0;u<t;u++)i.push(this.create.apply(this,c));return i}},{key:"shutdown",value:function(){"undefined"!==typeof window&&this.interceptor.shutdown(),"undefined"!==typeof window&&"test"===this.environment&&(window.server=void 0)}},{key:"resource",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.only,r=i.except,o=i.path;if(e=this.inflector.pluralize(e),o=o||"/".concat(e),n=n||[],r=r||[],n.length>0&&r.length>0)throw"cannot use both :only and :except options";var s={index:{methods:["get"],path:"".concat(o)},show:{methods:["get"],path:"".concat(o,"/:id")},create:{methods:["post"],path:"".concat(o)},update:{methods:["put","patch"],path:"".concat(o,"/:id")},delete:{methods:["del"],path:"".concat(o,"/:id")}},a=Object.keys(s),c=n.length>0&&n||r.length>0&&a.filter((function(e){return-1===r.indexOf(e)}))||a;c.forEach((function(i){var n=s[i];n.methods.forEach((function(i){return o===e?t[i](n.path):t[i](n.path,e)}))}))}},{key:"_serialize",value:function(e){return"string"===typeof e?e:JSON.stringify(e)}},{key:"registerRouteHandler",value:function(e,t,i,n,r){var o=this,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:this.middleware,a=this._container.create("RouteHandler",{schema:this.schema,verb:e,rawHandler:i,customizedCode:n,options:r,path:t,serializerOrRegistry:this.serializerOrRegistry,middleware:s});return function(e){return a.handle(e).then((function(e){var t=ce(e,3),i=t[0],n=t[1],r=t[2];return[i,n,o._serialize(r)]}))}}},{key:"_hasModulesOfType",value:function(e,t){var i=e[t];return!!i&&Object.keys(i).length>0}},{key:"_typeIsPluralForModel",value:function(e){if("boolean"!==typeof Nt[e]){var t=this._modelOrFactoryExistsForTypeOrCollectionName(e),i=e===this.inflector.pluralize(e),n=this.inflector.singularize(e)===this.inflector.pluralize(e),r=i&&!n&&t;Nt[e]=r}return Nt[e]}},{key:"_modelOrFactoryExistsForType",value:function(e){var t=this.schema&&this.schema.modelFor(Oe(e)),i=this.db[this.schema.toInternalCollectionName(e)];return(t||i)&&!this._typeIsPluralForModel(e)}},{key:"_modelOrFactoryExistsForTypeOrCollectionName",value:function(e){var t=this.schema&&this.schema.modelFor(Oe(e)),i=this.db[this.schema.toInternalCollectionName(e)];return t||i}},{key:"_validateTraits",value:function(e,t,i){e.forEach((function(e){if(!t.isTrait(e))throw new Error("'".concat(e,"' trait is not registered in '").concat(i,"' factory"))}))}},{key:"_mergeExtensions",value:function(e,t,i){var n=t.map((function(t){return e[t].extension}));return n.push(i||{}),n.reduce((function(e,t){return Y()(e,t)}),{})}},{key:"_mapAssociationsFromAttributes",value:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Object.keys(t||{}).filter((function(e){return Te(t[e])}
1)).forEach((function(r){var o=i.schema.modelClassFor(e),s=o.associationFor(r);Ee(s&&s instanceof De,"You're using the `association` factory helper on the '".concat(r,"' attribute of your ").concat(e," factory, but that attribute is not a `belongsTo` association."));var a=s&&s instanceof De&&s.modelName===e;Ee(!a,"You're using the association() helper on your ".concat(e," factory for ").concat(r,", which is a belongsTo self-referential relationship. You can't do this as it will lead to infinite recursion. You can move the helper inside of a trait and use it selectively."));var c=s&&s.opts&&s.opts.polymorphic;Ee(!c,"You're using the association() helper on your ".concat(e," factory for ").concat(r,", which is a polymorphic relationship. This is not currently supported."));var u=t[r],l="".concat(Oe(r),"Id");n[r]||(t[l]=i.create.apply(i,[s.modelName].concat(le(u.traitsAndOverrides))).id),delete t[r]}))}}]),e}(),Ct=ut.extend({serializeIds:"always",normalizeIds:!0,keyForModel:function(e){return ze(e)},keyForAttribute:function(e){return e=ut.prototype.keyForAttribute.apply(this,arguments),ze(e)},keyForRelationship:function(e){return this._container.inflector.pluralize(ze(e))},keyForEmbeddedRelationship:function(e){return ze(e)},keyForRelationshipIds:function(e){return"".concat(ze(this._container.inflector.singularize(e)),"_ids")},keyForForeignKey:function(e){return"".concat(ze(e),"_id")},keyForPolymorphicForeignKeyId:function(e){return"".concat(ze(e),"_id")},keyForPolymorphicForeignKeyType:function(e){return"".concat(ze(e),"_type")},normalize:function(e){var t=this,i=Object.keys(e)[0],n=e[i],r=Oe(i),o=this.schema.modelClassFor(r),s=o.belongsToAssociations,a=o.hasManyAssociations,c=Object.keys(s),u=Object.keys(a);"id"!==this.primaryKey&&(n.id=n[this.primaryKey],delete n[this.primaryKey]);var l={data:{type:this._container.inflector.pluralize(i),attributes:{}}};n.id&&(l.data.id=n.id);var h={};return Object.keys(n).forEach((function(e){if("id"!==e)if(t.normalizeIds)if(c.includes(e)){var i=s[e],r=i.modelName;h[Pe(e)]={data:{type:r,id:n[e]}}}else if(u.includes(e)){var o=a[e],d=o.modelName,f=n[e].map((function(e){return{type:d,id:e}}));h[Pe(e)]={data:f}}else l.data.attributes[Pe(e)]=n[e];else l.data.attributes[Pe(e)]=n[e]})),Object.keys(h).length&&(l.data.relationships=h),l},getCoalescedIds:function(e){return e.queryParams&&e.queryParams.ids}});Ct.extend({serializeIds:"always",keyForModel:function(e){return Oe(e)},keyForAttribute:function(e){return e=Ct.prototype.keyForAttribute.apply(this,arguments),Oe(e)},keyForRelationship:function(e){return Oe(this._container.inflector.pluralize(e))},keyForEmbeddedRelationship:function(e){return Oe(e)},keyForRelationshipIds:function(e){return Oe(this._container.inflector.pluralize(e))},keyForForeignKey:function(e){return Oe(this._container.inflector.singularize(e))},getCoalescedIds:function(e){return e.queryParams&&e.queryParams.ids}});function Ot(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return re(Qe,t)}function Pt(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return re(De,t)}},83503:function(e,t,i){(function(){var t=i(3939),n=i(92151).utf8,r=i(87206),o=i(92151).bin,s=function(e,i){e.constructor==String?e=i&&"binary"===i.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var a=t.bytesToWords(e),c=8*e.length,u=1732584193,l=-271733879,h=-1732584194,d=271733878,f=0;f<a.length;f++)a[f]=16711935&(a[f]<<8|a[f]>>>24)|4278255360&(a[f]<<24|a[f]>>>8);a[c>>>5]|=128<<c%32,a[14+(c+64>>>9<<4)]=c;var y=s._ff,m=s._gg,p=s._hh,v=s._ii;for(f=0;f<a.length;f+=16){var g=u,k=l,_=h,b=d;u=y(u,l,h,d,a[f+0],7,-680876936),d=y(d,u,l,h,a[f+1],12,-389564586),h=y(h,d,u,l,a[f+2],17,606105819),l=y(l,h,d,u,a[f+3],22,-1044525330),u=y(u,l,h,d,a[f+4],7,-176418897),d=y(d,u,l,h,a[f+5],12,1200080426),h=y(h,d,u,l,a[f+6],17,-1473231341),l=y(l,h,d,u,a[f+7],22,-45705983),u=y(u,l,h,d,a[f+8],7,1770035416),d=y(d,u,l,h,a[f+9],12,-1958414417),h=y(h,d,u,l,a[f+10],17,-42063),l=y(l,h,d,u,a[f+11],22,-1990404162),u=y(u,l,h,d,a[f+12],7,1804603682),d=y(d,u,l,h,a[f+13],12,-40341101),h=y(h,d,u,l,a[f+14],17,-1502002290),l=y(l,h,d,u,a[f+15],22,1236535329),u=m(u,l,h,d,a[f+1],5,-165796510),d=m(d,u,l,h,a[f+6],9,-1069501632),h=m(h,d,u,l,a[f+11],14,643717713),l=m(l,h,d,u,a[f+0],20,-373897302),u=m(u,l,h,d,a[f+5],5,-701558691),d=m(d,u,l,h,a[f+10],9,38016083),h=m(h,d,u,l,a[f+15],14,-660478335),l=m(l,h,d,u,a[f+4],20,-405537848),u=m(u,l,h,d,a[f+9],5,568446438),d=m(d,u,l,h,a[f+14],9,-1019803690),h=m(h,d,u,l,a[f+3],
114,-187363961),l=m(l,h,d,u,a[f+8],20,1163531501),u=m(u,l,h,d,a[f+13],5,-1444681467),d=m(d,u,l,h,a[f+2],9,-51403784),h=m(h,d,u,l,a[f+7],14,1735328473),l=m(l,h,d,u,a[f+12],20,-1926607734),u=p(u,l,h,d,a[f+5],4,-378558),d=p(d,u,l,h,a[f+8],11,-2022574463),h=p(h,d,u,l,a[f+11],16,1839030562),l=p(l,h,d,u,a[f+14],23,-35309556),u=p(u,l,h,d,a[f+1],4,-1530992060),d=p(d,u,l,h,a[f+4],11,1272893353),h=p(h,d,u,l,a[f+7],16,-155497632),l=p(l,h,d,u,a[f+10],23,-1094730640),u=p(u,l,h,d,a[f+13],4,681279174),d=p(d,u,l,h,a[f+0],11,-358537222),h=p(h,d,u,l,a[f+3],16,-722521979),l=p(l,h,d,u,a[f+6],23,76029189),u=p(u,l,h,d,a[f+9],4,-640364487),d=p(d,u,l,h,a[f+12],11,-421815835),h=p(h,d,u,l,a[f+15],16,530742520),l=p(l,h,d,u,a[f+2],23,-995338651),u=v(u,l,h,d,a[f+0],6,-198630844),d=v(d,u,l,h,a[f+7],10,1126891415),h=v(h,d,u,l,a[f+14],15,-1416354905),l=v(l,h,d,u,a[f+5],21,-57434055),u=v(u,l,h,d,a[f+12],6,1700485571),d=v(d,u,l,h,a[f+3],10,-1894986606),h=v(h,d,u,l,a[f+10],15,-1051523),l=v(l,h,d,u,a[f+1],21,-2054922799),u=v(u,l,h,d,a[f+8],6,1873313359),d=v(d,u,l,h,a[f+15],10,-30611744),h=v(h,d,u,l,a[f+6],15,-1560198380),l=v(l,h,d,u,a[f+13],21,1309151649),u=v(u,l,h,d,a[f+4],6,-145523070),d=v(d,u,l,h,a[f+11],10,-1120210379),h=v(h,d,u,l,a[f+2],15,718787259),l=v(l,h,d,u,a[f+9],21,-343485551),u=u+g>>>0,l=l+k>>>0,h=h+_>>>0,d=d+b>>>0}return t.endian([u,l,h,d])};s._ff=function(e,t,i,n,r,o,s){var a=e+(t&i|~t&n)+(r>>>0)+s;return(a<<o|a>>>32-o)+t},s._gg=function(e,t,i,n,r,o,s){var a=e+(t&n|i&~n)+(r>>>0)+s;return(a<<o|a>>>32-o)+t},s._hh=function(e,t,i,n,r,o,s){var a=e+(t^i^n)+(r>>>0)+s;return(a<<o|a>>>32-o)+t},s._ii=function(e,t,i,n,r,o,s){var a=e+(i^(t|~n))+(r>>>0)+s;return(a<<o|a>>>32-o)+t},s._blocksize=16,s._digestsize=16,e.exports=function(e,i){if(void 0===e||null===e)throw new Error("Illegal argument "+e);var n=t.wordsToBytes(s(e,i));return i&&i.asBytes?n:i&&i.asString?o.bytesToString(n):t.bytesToHex(n)}})()},97083:function(e,t,i){"undefined"!==typeof i.g&&"undefined"===typeof i.g.self&&(i.g.self={},i.g.__pretenderNodePolyfill=!0)}}]);
2//# sourceMappingURL=chunk-vendors-7291a857.932f2e27.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.