(function (H, a, A){ 'use strict'; function D(p, g){ g = g || { } ; a.forEach(g, function (a, c){ delete g[c]; } ); for (var c in p)p.hasOwnProperty(c) && ("$" !== c.charAt(0) && "$" !== c.charAt(1)) && (g[c] = p[c]); return g; } var v = a.$$minErr("$resource"), C = /^(\.[a-zA-Z_$][0-9a-zA-Z_$]*)+$/; a.module("ngResource", ["ng"] ).factory("$resource", ["$http", "$q", function (p, g){ function c(a, c){ this.template = a; this.defaults = c || { } ; this.urlParams = { } ; } function t(n, w, l){ function r(h, d){ var e = { } ; d = x({ } , w, d); s(d, function (b, d){ u(b) && (b = b()); var k; if (b && b.charAt && "@" == b.charAt(0)) { k = h; var a = b.substr(1); if (null == a || "" === a || "hasOwnProperty" === a || !C.test("." + a)) throw v("badmember", a) for (var a = a.split("."), f = 0, c = _AN_Read_length("length", a); f < c && k !== A; f++ ){ var g = a[f]; k = null !== k? k[g]: A; } } else k = b; e[d] = k; } ); return e; } function e(a){ return a.resource; } function f(a){ D(a || { } , this); } var F = new c(n); l = x({ } , B, l); s(l, function (h, d){ var c = /^(POST|PUT|PATCH)$/i.test(h.method); f[d] = function (b, d, k, w){ var q = { } , n, l, y; switch (arguments.length){ case 4: y = w, l = k; case 3: case 2: if (u(d)) { if (u(b)) { l = b; y = d; break ; } l = d; y = k; } else { q = b; n = d; l = k; break ; } case 1: u(b)? l = b: c? n = b: q = b; break ; case 0: break ; default : { throw v("badargs", _AN_Read_length("length", arguments)) } } var t = this instanceof f, m = t? n: h.isArray? [] : new f(n), z = { } , B = h.interceptor && h.interceptor.response || e, C = h.interceptor && h.interceptor.responseError || A; s(h, function (a, b){ "params" != b && ("isArray" != b && "interceptor" != b) && (z[b] = G(a)); } ); c && (z.data = n); F.setUrlParams(z, x({ } , r(n, h.params || { } ), q), _AN_Read_url("url", h)); q = p(z).then(function (b){ var d = b.data, k = m.$promise; if (d) { if (a.isArray(d) !== !!h.isArray) throw v("badcfg", h.isArray? "array": "object", a.isArray(d)? "array": "object") h.isArray? (m.length = 0, s(d, function (b){ m.push(new f(b)); } )): (D(d, m), m.$promise = k); } m.$resolved = true ; b.resource = m; return b; } , function (b){ m.$resolved = true ; (y || E)(b); return g.reject(b); } ); q = q.then(function (b){ var a = B(b); (l || E)(a, b.headers); return a; } , C); return t? q: (m.$promise = q, m.$resolved = false , m); } ; f.prototype["$" + d] = function (b, a, k){ u(b) && (k = a, a = b, b = { } ); b = f[d].call(this, b, this, a, k); return b.$promise || b; } ; } ); f.bind = function (a){ return t(n, x({ } , w, a), l); } ; return f; } var B = { get: { method: "GET"} , save: { method: "POST"} , query: { method: "GET", isArray: true } , remove: { method: "DELETE"} , "delete": { method: "DELETE"} } , E = a.noop, s = a.forEach, x = a.extend, G = a.copy, u = a.isFunction; c.prototype = { setUrlParams: function (c, g, l){ var r = this, e = l || r.template, f, p, h = r.urlParams = { } ; s(e.split(/\W/), function (a){ if ("hasOwnProperty" === a) throw v("badname") !/^\d+$/.test(a) && (a && RegExp("(^|[^\\\\]):" + a + "(\\W|$)").test(e)) && (h[a] = true ); } ); e = _AN_Call_replace("replace", e, /\\:/g, ":"); g = g || { } ; s(r.urlParams, function (d, c){ f = g.hasOwnProperty(c)? g[c]: r.defaults[c]; a.isDefined(f) && null !== f? (p = _AN_Call_replace("replace", _AN_Call_replace("replace", _AN_Call_replace("replace", _AN_Call_replace("replace", _AN_Call_replace("replace", _AN_Call_replace("replace", _AN_Call_replace("replace", _AN_Call_replace("replace", encodeURIComponent(f), /%40/gi, "@"), /%3A/gi, ":"), /%24/g, "$"), /%2C/gi, ","), /%20/g, "%20"), /%26/gi, "&"), /%3D/gi, "="), /%2B/gi, "+"), e = _AN_Call_replace("replace", e, RegExp(":" + c + "(\\W|$)", "g"), p + "$1")): e = _AN_Call_replace("replace", e, RegExp("(/?):" + c + "(\\W|$)", "g"), function (a, c, d){ return "/" == d.charAt(0)? d: c + d; } ); } ); e = _AN_Call_replace("replace", e, /\/+$/, "") || "/"; e = _AN_Call_replace("replace", e, /\/\.(?=\w+($|\?))/, "."); _AN_Write_url("url", c, false , _AN_Call_replace("replace", e, /\/\\\./, "/.")); s(g, function (a, e){ r.urlParams[e] || (c.params = c.params || { } , c.params[e] = a); } ); } } ; return t; } ] ); } )(window, window.angular);