text: /*!
  * js-data-firebase
  * @version 1.1.2 - Homepage <http://wwwjs-data.io/docs/dsfirebaseadapter>
  * @author Jason Dobry <jason.dobry@gmail.com>
  * @copyright (c) 2014-2015 Jason Dobry
  * @license MIT <https://github.com/js-data/js-data-firebase/blob/master/LICENSE>
  *
  * @overview Firebase adapter for js-data.
  */
  
  !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data"),require("firebase")):"function"==typeof define&&define.amd?define(["js-data","firebase"],b):"object"==typeof exports?exports.DSFirebaseAdapter=b(require("js-data"),require("firebase")):a.DSFirebaseAdapter=b(a.JSData,a.Firebase)}(this,function(a,b){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){var d=function(a){return a&&a.__esModule?a:{"default":a}},e=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}(),f=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(b,"__esModule",{value:!0});var g=c(1),h=d(g),i=c(2),j=d(i),k=c(3),l=d(k),m=c(4),n=d(m),o=new h["default"].DS,p=h["default"].DSUtils,q=p.deepMixIn,r=p.removeCircular,s=p.Promise,t=p.forOwn,u=o.defaults.defaultFilter,v=function x(){f(this,x)};v.prototype.basePath="";var w=function(){function a(b){f(this,a),b=b||{},this.defaults=new v,q(this.defaults,b),this.ref=new j["default"](b.basePath||this.defaults.basePath)}return e(a,[{key:"getRef",value:function(a,b){return b=b||{},this.ref.child(b.endpoint||a.endpoint)}},{key:"find",value:function(a,b,c){var d=this;return new s(function(e,f){return d.getRef(a,c).child(b).once("value",function(c){var d=c.val();d?(d[a.idAttribute]=d[a.idAttribute]||b,e(d)):f(new Error("Not Found!"))},f,d)})}},{key:"findAll",value:function(a,b,c){var d=this;return new s(function(e,f){return d.getRef(a,c).once("value",function(d){var f=d.val();t(f,function(b,c){b[a.idAttribute]||(b[a.idAttribute]="/"+c)}),e(u.call(o,n["default"](f),a.name,b,c))},f,d)})}},{key:"create",value:function(a,b,c){var d=this,e=b[a.idAttribute];return p.isString(e)||p.isNumber(e)?this.update(a,e,b,c):new s(function(e,f){var g=d.getRef(a,c),h=g.push(r(l["default"](b,a.relationFields||[])),function(b){if(b)return f(b);var c=h.toString().replace(g.toString(),"");h.child(a.idAttribute).set(c,function(a){a?f(a):h.once("value",function(a){try{e(a.val())}catch(b){f(b)}},f,d)})})})}},{key:"update",value:function(a,b,c,d){var e=this;return c=r(l["default"](c||{},a.relationFields||[])),new s(function(f,g){var h=e.getRef(a,d).child(b);h.once("value",function(b){try{!function(){var d=b.val()||{},e=void 0,i=void 0,j=void 0;if(a.relations)for(e=a.relationFields,i=[],j=0;j<e.length;j++)i.push(c[e[j]]),delete c[e[j]];if(q(d,c),a.relations)for(e=a.relationFields,j=0;j<e.length;j++){var k=i.shift();k&&(c[e[j]]=k)}h.set(d,function(a){a?g(a):f(d)})}()}catch(d){g(d)}},g,e)})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return this.findAll(a,c,d).then(function(c){var f=[];return p.forEach(c,function(c){f.push(e.update(a,c[a.idAttribute],b,d))}),s.all(f)})}},{key:"destroy",value:function(a,b,c){var d=this;return new s(function(e,f){d.getRef(a,c).child(b).remove(function(a){a?f(a):e()})})}},{key:"destroyAll",value:function(a,b,c){var d=this;return this.findAll(a,b,c).then(function(b){var e=[];return p.forEach(b,function(b){e.push(d.destroy(a,b[a.idAttribute],c))}),s.all(e)})}}]),a}();b["default"]=w,a.exports=b["default"]},function(b,c,d){b.exports=a},function(a,c,d){a.exports=b},function(a,b,c){function d(a,b){var c="string"!=typeof arguments[1]?arguments[1]:e(arguments,1),d={};for(var g in a)a.hasOwnProperty(g)&&!f(c,g)&&(d[g]=a[g]);return d}var e=c(5),f=c(6);a.exports=d},function(a,b,c){function d(a){var b=[];return e(a,function(a,c){b.push(a)}),b}var e=c(7);a.exports=d},function(a,b,c){function d(a,b,c){var d=a.length;b=null==b?0:0>b?Math.max(d+b,0):Math.min(b,d),c=null==c?d:0>c?Math.max(d+c,0):Math.min(c,d);for(var e=[];c>b;)e.push(a[b++]);return e}a.exports=d},function(a,b,c){function d(a,b){return-1!==e(a,b)}var e=c(10);a.exports=d},function(a,b,c){function d(a,b,c){f(a,function(d,f){return e(a,f)?b.call(c,a[f],f,a):void 0})}var e=c(8),f=c(9);a.exports=d},function(a,b,c){function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}a.exports=d},function(a,b,c){function d(){h=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],g=!0;for(var a in{toString:null})g=!1}function e(a,b,c){var e,j=0;null==g&&d();for(e in a)if(f(b,a,e,c)===!1)break;if(g)for(var k=a.constructor,l=!!k&&a===k.prototype;(e=h[j++])&&("constructor"===e&&(l||!i(a,e))||a[e]===Object.prototype[e]||f(b,a,e,c)!==!1););}function f(a,b,c,d){return a.call(d,b[c],c,b)}var g,h,i=c(8);a.exports=e},function(a,b,c){function d(a,b,c){if(c=c||0,null==a)return-1;for(var d=a.length,e=0>c?d+c:c;d>e;){if(a[e]===b)return e;e++}return-1}a.exports=d}])});
  //# sourceMappingURL=js-data-firebase.min.map