friendica-addons/advancedcontentfilter/vendor/asset/vue-resource/dist/vue-resource.min.js

7 lines
15 KiB
JavaScript
Raw Normal View History

/*!
* vue-resource v1.5.0
* https://github.com/pagekit/vue-resource
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.VueResource=e()}(this,function(){"use strict";var t=2;function e(e){this.state=t,this.value=void 0,this.deferred=[];var n=this;try{e(function(t){n.resolve(t)},function(t){n.reject(t)})}catch(t){n.reject(t)}}e.reject=function(t){return new e(function(e,n){n(t)})},e.resolve=function(t){return new e(function(e,n){e(t)})},e.all=function(t){return new e(function(n,o){var r=0,i=[];function s(e){return function(o){i[e]=o,(r+=1)===t.length&&n(i)}}0===t.length&&n(i);for(var u=0;u<t.length;u+=1)e.resolve(t[u]).then(s(u),o)})},e.race=function(t){return new e(function(n,o){for(var r=0;r<t.length;r+=1)e.resolve(t[r]).then(n,o)})};var n=e.prototype;function o(t,e){t instanceof Promise?this.promise=t:this.promise=new Promise(t.bind(e)),this.context=e}n.resolve=function(e){var n=this;if(n.state===t){if(e===n)throw new TypeError("Promise settled with itself.");var o=!1;try{var r=e&&e.then;if(null!==e&&"object"==typeof e&&"function"==typeof r)return void r.call(e,function(t){o||n.resolve(t),o=!0},function(t){o||n.reject(t),o=!0})}catch(t){return void(o||n.reject(t))}n.state=0,n.value=e,n.notify()}},n.reject=function(e){var n=this;if(n.state===t){if(e===n)throw new TypeError("Promise settled with itself.");n.state=1,n.value=e,n.notify()}},n.notify=function(){var e,n=this;i(function(){if(n.state!==t)for(;n.deferred.length;){var e=n.deferred.shift(),o=e[0],r=e[1],i=e[2],s=e[3];try{0===n.state?i("function"==typeof o?o.call(void 0,n.value):n.value):1===n.state&&("function"==typeof r?i(r.call(void 0,n.value)):s(n.value))}catch(t){s(t)}}},e)},n.then=function(t,n){var o=this;return new e(function(e,r){o.deferred.push([t,n,e,r]),o.notify()})},n.catch=function(t){return this.then(void 0,t)},"undefined"==typeof Promise&&(window.Promise=e),o.all=function(t,e){return new o(Promise.all(t),e)},o.resolve=function(t,e){return new o(Promise.resolve(t),e)},o.reject=function(t,e){return new o(Promise.reject(t),e)},o.race=function(t,e){return new o(Promise.race(t),e)};var r=o.prototype;r.bind=function(t){return this.context=t,this},r.then=function(t,e){return t&&t.bind&&this.context&&(t=t.bind(this.context)),e&&e.bind&&this.context&&(e=e.bind(this.context)),new o(this.promise.then(t,e),this.context)},r.catch=function(t){return t&&t.bind&&this.context&&(t=t.bind(this.context)),new o(this.promise.catch(t),this.context)},r.finally=function(t){return this.then(function(e){return t.call(this),e},function(e){return t.call(this),Promise.reject(e)})};var i,s={}.hasOwnProperty,u=[].slice,a=!1,c="undefined"!=typeof window;function f(t){return t?t.replace(/^\s*|\s*$/g,""):""}function p(t){return t?t.toLowerCase():""}var h=Array.isArray;function d(t){return"string"==typeof t}function l(t){return"function"==typeof t}function m(t){return null!==t&&"object"==typeof t}function y(t){return m(t)&&Object.getPrototypeOf(t)==Object.prototype}function v(t,e,n){var r=o.resolve(t);return arguments.length<2?r:r.then(e,n)}function b(t,e,n){return l(n=n||{})&&(n=n.call(e)),T(t.bind({$vm:e,$options:n}),t,{$options:n})}function g(t,e){var n,o;if(h(t))for(n=0;n<t.length;n++)e.call(t[n],t[n],n);else if(m(t))for(o in t)s.call(t,o)&&e.call(t[o],t[o],o);return t}var w=Object.assign||function(t){return u.call(arguments,1).forEach(function(e){x(t,e)}),t};function T(t){return u.call(arguments,1).forEach(function(e){x(t,e,!0)}),t}function x(t,e,n){for(var o in e)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)):void 0!==e[o]&&(t[o]=e[o])}function j(t,e,n){var o,r,i,s=(o=t,r=["+","#",".","/",";","?","&"],{vars:i=[],expand:function(t){return o.replace(/\{([^{}]+)\}|([^{}]+)/g,function(e,n,o){if(n){var s=null,u=[];if(-1!==r.indexOf(n.charAt(0))&&(s=n.charAt(0),n=n.substr(1)),n.split(/,/g).forEach(function(e){var n=/([^:*]*)(?::(\d+)|(\*))?/.exec(e);u.push.apply(u,function(t,e,n,o){var r=t[n],i=[];if(E(r)&&""!==r)if("string"==typeof r||"number"==typeof r||"boolean"==typeof r)r=r.toString(),o&&"*"!==o&&(r=r.substring(0,