!function(t,e){"object"==typeofexports&&"undefined"!=typeofmodule?module.exports=e():"function"==typeofdefine&&define.amd?define(e):t.VueResource=e()}(this,function(){"use strict";functionu(t){this.state=2,this.value=void0,this.deferred=[];vare=this;try{t(function(t){e.resolve(t)},function(t){e.reject(t)})}catch(t){e.reject(t)}}u.reject=function(n){returnnewu(function(t,e){e(n)})},u.resolve=function(n){returnnewu(function(t,e){t(n)})},u.all=function(s){returnnewu(function(n,t){varo=0,r=[];functione(e){returnfunction(t){r[e]=t,(o+=1)===s.length&&n(r)}}0===s.length&&n(r);for(vari=0;i<s.length;i+=1)u.resolve(s[i]).then(e(i),t)})},u.race=function(o){returnnewu(function(t,e){for(varn=0;n<o.length;n+=1)u.resolve(o[n]).then(t,e)})};vart=u.prototype;functionc(t,e){tinstanceofPromise?this.promise=t:this.promise=newPromise(t.bind(e)),this.context=e}t.resolve=function(t){vare=this;if(2===e.state){if(t===e)thrownewTypeError("Promise settled with itself.");varn=!1;try{varo=t&&t.then;if(null!==t&&"object"==typeoft&&"function"==typeofo)returnvoido.call(t,function(t){n||e.resolve(t),n=!0},function(t){n||e.reject(t),n=!0})}catch(t){returnvoid(n||e.reject(t))}e.state=0,e.value=t,e.notify()}},t.reject=function(t){vare=this;if(2===e.state){if(t===e)thrownewTypeError("Promise settled with itself.");e.state=1,e.value=t,e.notify()}},t.notify=function(){vart,i=this;r(function(){if(2!==i.state)for(;i.deferred.length;){vart=i.deferred.shift(),e=t[0],n=t[1],o=t[2],r=t[3];try{0===i.state?o("function"==typeofe?e.call(void0,i.value):i.value):1===i.state&&("function"==typeofn?o(n.call(void0,i.value)):r(i.value))}catch(t){r(t)}}},t)},t.then=function(n,o){varr=this;returnnewu(function(t,e){r.deferred.push([n,o,t,e]),r.notify()})},t.catch=function(t){returnthis.then(void0,t)},"undefined"==typeofPromise&&(window.Promise=u),c.all=function(t,e){returnnewc(Promise.all(t),e)},c.resolve=function(t,e){returnnewc(Promise.resolve(t),e)},c.reject=function(t,e){returnnewc(Promise.reject(t),e)},c.race=function(t,e){returnnewc(Promise.race(t),e)};vare=c.prototype;e.bind=function(t){returnthis.context=t,this},e.then=function(t,e){returnt&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),newc(this.promise.then(t,e),this.context)},e.catch=function(t){returnt&&t.bind&&this.context&&(t=t.bind(this.context)),newc(this.promise.catch(t),this.context)},e.finally=function(e){returnthis.then(function(t){returne.call(this),t},function(t){returne.call(this),Promise.reject(t)})};varr,i={}.hasOwnProperty,o=[].slice,a=!1,s="undefined"!=typeofwindow;functionf(t){returnt?t.replace(/^\s*|\s*$/g,""):""}functionp(t){returnt?t.toLowerCase():""}varh=Array.isArray;functiond(t){return"string"==typeoft}functionl(t){return"function"==typeoft}functionm(t){returnnull!==t&&"object"==typeoft}functiony(t){returnm(t)&&Object.getPrototypeOf(t)==Object.prototype}functionv(t,e,n){varo=c.resolve(t);returnarguments.length<2?o:o.then(e,n)}functionb(t,e,n){returnl(n=n||{})&&(n=n.call(e)),T(t.bind({$vm:e,$options:n}),t,{$options:n})}functiong(t,e){varn,o;if(h(t))for(n=0;n<t.length;n++)e.call(t[n],t[n],n);elseif(m(t))for(oint)i.call(t,o)&&e.call(t[o],t[o],o);returnt}varw=Object.assign||function(e){returno.call(arguments,1).forEach(function(t){x(e,t)}),e};functionT(e){returno.call(arguments,1).forEach(function(t){x(e,t,!0)}),e}functionx(t,e,n){for(varoine)n&&(y(e[o])||h(e[o]))?(y(e[o])&&!y(t[o])&&(t[o]={}),h(e[o])&&!h(t[o])&&(t[o]=[]),x(t[o],e[o],n)):void0!==e[o]&&(t[o]=e[o])}functionj(t,e,n){varo,u,a,r=(o=t,u=["+","#",".","/",";","?","&"],{vars:a=[],expand:function(s){returno.replace(/\{([^{}]+)\}|([^{}]+)/g,function(t,e,n){if(e){varo=null,r=[];if(-1!==u.indexOf(e.charAt(0))&&(o=e.charAt(0),e=e.substr(1)),e.split(/,/g).forEach(function(t){vare=/([^:*]*)(?::(\d+)|(\*))?/.exec(t);r.push.apply(r,function(t,e,n,o){varr=t[n],i=[];if(E(r)&&""!==r)if("string"==typeofr||"number"==typeofr||"boolean"==typeofr)r=r.toString(),o&&"*"!==o&&(r=r.substring(0,parseInt(o,10))),i.push(O(e,r,P(e)?n:null));elseif("*"===o)Array.isArray(r)?r.filter(E).forEach(function(t){i.push(O(e,t,P(e)?n:null))}):Object.keys(r).forEach(function(t){E(r[t])&&i.push(O(e,r[t],t))});else{vars=[];Array.isArray(r)?r.filter(E).forEach(function(t){s.push(O(e,t))}):Object.keys(r).forEach(function(t){E(r[t])&&(s.push(encodeURIComponent(t)),s.push(O(e,r[t].toString())))}),P(e)?i.push(encodeURIComponent(n)+"="+s.join(",")):0!==s.length&&i.push(s.join(","))}else";"===e?i.push(encodeURIComponent(n)):""!==r||"&"!==e&&"?"!==e?""===r&&i.push(""):i.push(encodeURIComponent(n)+"=");returni}(s,o,e[1],e[2]||e[3])),a.push(e[1])}),o&&"+"!==o){vari=",";return"?"===o?i="&":"#"!==o&&(i=o),(0!==r.length?o:"")+r.join(i)}returnr.join(",")}returnC(n)})}}),i=r.expand(e);returnn&&n.push.apply(n,r.vars),i}functionE(t){returnnull!=t}functionP(t){return";"===t||"&"===t||"?"===t}functionO(t,e,n){returne="+"===t||"#"===t?C(e):encodeURIComponent(e),n?encodeURIComponent(n)+"="+e:e}functionC(t){returnt.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t)),t}).join("")}function$(t,e){varr,i=this||{},n=t;returnd(t)&&(n={url:t,params:e}),n=T({},$.options,i.$options,n),$.transforms.forEach(function(t){vare,n,o;d(t)&&(t=$.transform[t]),l(t)&&(e=t,n=r,o=i.$vm,r=function(t){returne.call(o,t,n)})}),r(n)}functionU(i){returnnewc(function(o){varr=newXDomainRequest,t=function(t){vare=t.type,n=0;"load"===e?n=200:"error"===e&&(n=500),o(i.respondWith(r.responseText,{status:n}))};i.abort=function(){returnr.abort()},r.open(i.method,i.getUrl()),i.timeout&&(r.timeout=i.timeout),r.onload=t,r.onabort=t,r.onerror=t,r.ontimeout=t,r.onprogress=function(){},r.send(i.getBody())})}$.options={url:"",root:null,params:{}},$.transform={template:function(e){vart=[],n=j(e.url,e.params,t);returnt.forEach(function(t){deletee.params[t]}),n},query:function(t,e){varn=Object.keys($.options.params),o={},r=e(t);returng(t.params,function(t,e){-1===n.indexOf(e)&&(o[e]=t)}),(o=$.params(o))&&(r+=(-1==r.indexOf("?")?"?":"&")+o),r},root:function(t,e){varn,o,r=e(t);returnd(t.root)&&!/^(https?:)?\//.test(r)&&(n=t.root,o="/",r=(n&&void0===o?n.replace(/\s+$/,""):n&&o?n.replace(newRegExp("["+o+"]+$"),""):n)+"/"+r),r}},$.transforms=["template","query","root"],$.params=function(t){vare=[],n=encodeURIComponent;returne.add=function(t,e){l(e)&&(e=e()),null===e&&(e=""),this.push(n(t)+"="+n(e))},functionn(o,t,r){vari,s=h(t),u=y(t);g(t,function(t,e){i=m(t)||h(t),r&&(e=r+"["+(u||i?e:"")+"]"),!r&&s?o.add(t.name,t.value):i?n(o,t,e):o.add(e,t)})}(e,t),e.join("&").replace(/%20/g,"+")},$.parse=function(t){vare=document.createElement("a");returndocument.documentMode&&(e.href=t,t=e.href),e.href=t,{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",port:e.port,host:e.host,hostname:e.hostname,pathname:"/"===e.pathname.charAt(0)?e.pathname:"/"+e.pathname,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):""}};varR=s&&"withCredentials"innewXMLHttpRequest;functionn(u){returnnewc(function(o){vart,r,e=u.jsonp||"callback",i=u.jsonpCallback||"_jsonp"+Math.random().toString(36).substr(2),s=null;t=function(t){vare=t.type,n=0;"load"===e&&null!==s?n=200:"error"===e&&(n=500),n&&window[i]&&(deletewindow[i],document.body.removeChild(r)),o(u.respondWith(s,{status:n}))},window[i]=function(t){s=JSON.stringify(t)},u.abort=function(){t({type:"abort"})},u.params[e]=i,u.timeout&&setTimeout(u.abort,u.timeout),(r=document.createElement("script")).src=u.getUrl(),r.type="text/javascript",r.async=!0,r.onload=t,r.onerror=t,document.body.appendChild(r)})}functionA(r){returnnewc(function(n){varo=newXMLHttpRequest,t=function(t){vare=r.respondWith("response"ino?o.response:o.responseText,{status:1223===o.status?204:o.status,statusText:1223===o.status?"No Content":f(o.statusText)});g(f(o.getAllResponseHeaders()).split("\n"),function(t){e.headers.append(t.slice(0,t.indexOf(":")),t.slice(t.indexOf(":")+1))}),n(e)};r.abort=function(){returno.abort()},o.open(r.method,r.getUrl(),!0),r.timeout&&(o.timeout=r.timeout),r.responseType&&"responseType"ino&&(o.responseType=r.responseType),(r.withCredentials||r.credentials)&&(o.withCredentials=!0),r.crossOrigin||r.headers.set("X-Requested-With","XMLHttpRequest"),l(r.progress)&&"GET"===r.method&&o.addEventListener("progress",r.progress),l(r.downloadProgress)&&o.addEventListener("progress",r.downloadProgress),l(r.progress)&&/^(POST|PUT)$/i.test(r.method)&&o.upload.addEventListener("progress",r.progress),l(r.uploadProgress)&&o.upload&&o.upload.addEventListener("progress",r.uploadProgress),r.headers.forEach(function(t,e){o.setRequestHeader(e,t)}),o.onload=t,o.onabort=t,o.onerror=t,o.ontimeout=t,o.send(r.getBody())})}functionS(s){varu=require("got");returnnewc(function(e){varn,t=s.getUrl(),o=s.getBody(),r=s.method,i={};s.headers.forEach(function(t,e){i[e]=t}),u(t,{body:o,method:r,headers:i}).then(n=function(t){varn=s.respondWith(t.body,{status:t.statusCode,statusText:f(t.statusMessage)});g(t.headers,function(t,e){n.headers.set(e,t)}),e(n)},function(t){returnn(t.response)})})}functionk(t){return(t.client||(s?A:S))(t)}varI=function(t){varn=this;this.map={},g(t,function(t,e){returnn.append(e,t)})};functionL(t,n){returnObject.keys(t).reduce(function(t,e){returnp(n)===p(e)?e:t},null)}I.prototype.has=function(t){returnnull!==L(this.map,t)},I.prototype.get=function(t){vare=this.map[L(this.map,t)];returne?e.join():null},I.prototype.getAll=function(t){returnthis.map[L(this.map,t)]||[]},I.prototype.set=function(t,e){this.map[function(t){if(/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))thrownewTypeError("Invalid character in header field name");returnf(t)}(L(this.map,t)||t)]=[f(e)]},I.prototype.append=function(t,e){varn=this.map[L(this.map,t)];n?n.push(f(e)):this.set(t,e)},I.prototype.delete=function(t){deletethis.map[L(this.map,t)]},I.prototype.deleteAll=function(){this.map={}},I.prototype.forEach=function(n,o){varr=this;g(this.map,function(t,e){g(t,function(t){returnn.call(o,t,e,r)})})};varq=function(t,e){varn,o,r,i=e.url,s=e.headers,u=e.status,a=e.statusText;this.url=i,this.ok=200<=u&&u<300,this.status=u||0,this.statusText=a||"",this.headers=newI(s),d(this.body=t)?this.bodyText=t:(r=t,"undefined"!=typeofBlob&&rinstanceofBlob&&(this.bodyBlob=t,(0===(o=t).type.indexOf("text")||-1!==o.type.indexOf("json"))&&(this.bodyText=(n=t,newc(function(t){vare=newFileReader;e.readAsText(n),e.onload=function(){t(e.result)}})))))};q.prototype.blob=function(){returnv(this.bodyBlob)},q.prototype.text=function(){returnv(this.bodyText)},q.prototype.json=function(){returnv(this.text(),function(t){returnJSON.parse(t)})},Object.defineProperty(q.prototype,"data",{get:function(){returnthis.body},set:function(t){this.body=t}});varH=function(t){vare;this.body=null,this.params={},w(this,t,{method:(e=t.method||"GET",e?e.toUpperCase():"")}),this.headersinstanceofI||(this.headers=newI(this.headers))};H.prototype.getUrl=function(){return$(this)},H.prototype.getBody=function(){returnthis.body},H.prototype.respondWith=function(t,e){returnnewq(t,w(e||{},{url:this.getUrl()}))};varB={"Content-Type":"application/json;charset=utf-8"};functionM(t){vare=this||{},n=function(i){vars=[k],u=[];functiont(t){for(;s.length;){vare=s.pop();if(l(e)){varo=void0,n=void0;if(m(o=e.call(i,t,function(t){returnn=t})||n))returnnewc(function(t,n){u.forEach(function(e){o=v(o,function(t){returne.call(i,t)||t},n)}),v(o,t,n)},i);l(o)&&u.unshift(o)}elser="Invalid interceptor of type "+typeofe+", must be a function","undefined"!=typeofconsole&&a&&console.warn("[VueResource warn]: "+r)}varr}returnm(i)||(i=null),t.use=function(t){s.push(t)},t}(e.$vm);returnfunction(n){o.call(arguments,1).forEach(function(t){for(vareint)void0===n[e]&&(n[e]=t[e])})}(t||{},e.$options,M.options),M.interceptors.forEach(function(t){d(t)&&(t=M.interceptor[t]),l(t)&&n.use(t)}),n(newH(t)).then(function(t){returnt.ok?t:c.reject(t)},function(t){vare;returntinstanceofError&&(e=t,"undefined"!=typeofconsole&&console.error(e)),c.reject(t)})}functionN(n,o,t,r){vari=this||{},s={};returng(t=w({},N.actions,t),function(t,e){t=T({url:n,params:w({},o)},r,t),s[e]=function(){return(i.$http||M)(function(t,e){varn,o=w({},t),r={};switch(e.length){case2:r=e[0],n=e[1];break;case1:/^(POST|PUT|PATCH)$/i.test(o.method)?n=e[0]:r=e[0];break;case0:break;default:throw"Expected up to 2 arguments [params, body], got "+e.length+" arguments"}returno.body=n,o.params=w({},o.params,r),o}(t,arguments))}}),s}functionD(n){vart,e,o;D.installed||(e=(t=n).config,o=t.nextTick,r=o,a=e.debug||!e.silent,n.url=$,n.http=M,n.resource=N,n.Promise=c,Object.defineProperties(n.prototype,{$url:{get:function(){returnb(n.url,this,this.$options.url)}},$http:{get:function(){returnb(n.http,this,this.$options.http)}},$resource:{get:function(){returnn.resource.bind(this)}},$promise:{get:function(){vare=this;returnfunction(t){returnnewn.Promise(t,e)}}}}))}returnM.options={},M.headers={put:B,post:B,patch:B,delete:B,common:{Accept:"application/json, text/plain, */*"},custom:{}},M.interceptor={before:function(t){l(t.before)&&t.before.call(this,t)},method:function(t){t.emulateHTTP&&/^(PUT|PATCH|DELETE)$/i.test(t.method)&&(t.headers.set("X-HTTP-Method-Override",t.method),t.method="POST")},jsonp:function(t){"JSONP"==t.method&&(t.client=n)},json:function(t){vare=t.headers.get("Content-Type")||"";returnm(t.body)&&0===e.indexOf("application/json")&&(t.body=JSON.stringify(t.body)),function(o){returno.bodyText?v(o.text(),function(t){vare,n;if(0===(o.headers.get("Content-Type")||"").indexOf("application/json")||(n=(e=t).match(/^\s*(\[|\{)/))&&{"[":/]\s*$/,"{":/}\s*$/}[n[1]].test(e))try{o.body=JSON.parse(t)}catch(t){o.body=null}elseo.body=t;returno}):o}},form:function(t){vare;e=t.body,"undefined"!=typeofFormData&&einstanceofFormData?t.headers.delete("Content-Type"):m(t.body)&&t.emulateJSON&&(t.body=$.params(t.body),t.headers.set("Content-Type","application/x-www-form-urlencoded"))},header:function(n){g(w({},M.headers.common,n.crossOrigin?{}:M.headers.custom,M.headers[p(n.method)]),function(t,e){n.headers.has(e)||n.headers.set(e,t)})},cors:function(t){if(s){vare=$.parse(location.href),n=$.parse(t.getUrl());n.protocol===e.protocol&&n.host===e.host||(t.crossOrigin=!0,t.emulateHTTP=!1,R||(t.client=U))}}},M.interceptors=["before","method","jsonp","json","form","header","cors"],["get","delete","head","jsonp"].forEach(function(n){M[n]=function(t,e){returnthis(w(e||{},{url:t,method:n}))}}),["post","put","patch"].forEach(function(o){M[o]=function(t,e,n){returnthis(w(n||{},{url:t,method:o,body:e}))}}),N.actions={get:{method:"GET"},save:{method:"POST"},query:{method:"GET"},update:{method:"PUT"},remove:{method:"DELETE"},delete:{method:"DELETE"}},"undefined"!=typeofwindow&&window.Vue&&window.Vue.use(D),D});