filesbox/web/dist/reader/js/reader.min.js

8 lines
36 KiB
JavaScript
Raw Normal View History

2024-07-26 06:10:54 +00:00
/*!
* @overview RSVP - a tiny implementation of Promises/A+.
* @copyright Copyright (c) 2016 Yehuda Katz, Tom Dale, Stefan Penner and contributors
* @license Licensed under MIT license
* See https://raw.githubusercontent.com/tildeio/rsvp.js/master/LICENSE
* @version 3.6.2
*/(function(n,r){typeof exports=="object"&&typeof module!="undefined"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):r(n.RSVP=n.RSVP||{})})(this,function(n){"use strict";function r(e,t){for(var o=0,s=e.length;o<s;o++)if(e[o]===t)return o;return-1}function i(e){var t=e._promiseCallbacks;return t||(t=e._promiseCallbacks={}),t}function c(e,t){if(arguments.length!==2)return E[e];E[e]=t}function a(e){var t=typeof e;return e!==null&&(t==="object"||t==="function")}function l(e){return typeof e=="function"}function h(e){return e!==null&&typeof e=="object"}function d(e){return e!==null&&typeof e=="object"}function m(){setTimeout(function(){for(var e=0;e<ee.length;e++){var t=ee[e],o=t.payload;o.guid=o.key+o.id,o.childGuid=o.key+o.childId,o.error&&(o.stack=o.error.stack),E.trigger(t.name,t.payload)}ee.length=0},50)}function p(e,t,o){ee.push({name:e,payload:{key:t._guidKey,id:t._id,eventName:e,detail:t._result,childId:o&&o._id,label:t._label,timeStamp:je(),error:E["instrument-with-stack"]?new Error(t._label):null}})===1&&m()}function v(e,t){var o=this;if(e&&typeof e=="object"&&e.constructor===o)return e;var s=new o(C,t);return b(s,e),s}function k(){return new TypeError("A promises callback cannot return that same promise.")}function C(){}function R(e){try{return e.then}catch(t){return Q.error=t,Q}}function j(e,t,o,s){try{e.call(t,o,s)}catch(u){return u}}function N(e,t,o){E.async(function(s){var u=!1,f=j(o,t,function(y){u||(u=!0,t!==y?b(s,y,void 0):_(s,y))},function(y){u||(u=!0,O(s,y))},"Settle: "+(s._label||" unknown promise"));!u&&f&&(u=!0,O(s,f))},e)}function S(e,t){t._state===B?_(e,t._result):t._state===V?(t._onError=null,O(e,t._result)):L(t,void 0,function(o){t!==o?b(e,o,void 0):_(e,o)},function(o){return O(e,o)})}function x(e,t,o){t.constructor===e.constructor&&o===I&&e.constructor.resolve===v?S(e,t):o===Q?(O(e,Q.error),Q.error=null):l(o)?N(e,t,o):_(e,t)}function b(e,t){e===t?_(e,t):a(t)?x(e,t,R(t)):_(e,t)}function g(e){e._onError&&e._onError(e._result),D(e)}function _(e,t){e._state===K&&(e._result=t,e._state=B,e._subscribers.length===0?E.instrument&&p("fulfilled",e):E.async(D,e))}function O(e,t){e._state===K&&(e._state=V,e._result=t,E.async(g,e))}function L(e,t,o,s){var u=e._subscribers,f=u.length;e._onError=null,u[f]=t,u[f+B]=o,u[f+V]=s,f===0&&e._state&&E.async(D,e)}function D(e){var t=e._subscribers,o=e._state;if(E.instrument&&p(o===B?"fulfilled":"rejected",e),t.length!==0){for(var s=void 0,u=void 0,f=e._result,y=0;y<t.length;y+=3)s=t[y],u=t[y+o],s?H(o,s,u,f):u(f);e._subscribers.length=0}}function F(){this.error=null}function T(e,t){try{return e(t)}catch(o){return le.error=o,le}}function H(e,t,o,s){var u=l(o),f=void 0,y=void 0;if(u){if((f=T(o,s))===le)y=f.error,f.error=null;else if(f===t)return void O(t,k())}else f=s;t._state!==K||(u&&y===void 0?b(t,f):y!==void 0?O(t,y):e===B?_(t,f):e===V&&O(t,f))}function z(e,t){var o=!1;try{t(function(s){o||(o=!0,b(e,s))},function(s){o||(o=!0,O(e,s))})}catch(s){O(e,s)}}function I(e,t,o){var s=this,u=s._state;if(u===B&&!e||u===V&&!t)return E.instrument&&p("chained",s,s),s;s._onError=null;var f=new s.constructor(C,o),y=s._result;if(E.instrument&&p("chained",s,f),u===K)L(s,f,e,t);else{var P=u===B?e:t;E.async(function(){return H(u,f,P,y)})}return f}function X(e,t,o){return e===B?{state:"fulfilled",value:o}:{state:"rejected",reason:o}}function ne(e,t){return U(e)?new ue(this,e,!0,t).promise:this.reject(new TypeError("Promise.all must be called with an array"),t)}function G(e,t){var o=this,s=new o(C,t);if(!U(e))return O(s,new TypeError("Promise.race must be called with an array")),s;for(var u=0;s._state===K&&u<e.length;u++)L(o.resolve(e[u]),void 0,function(f){return b(s,f)},function(f){return O(s,f)});return s}function Xe(e,t){var o=this,s=new o(C,t);return O(s,e),s}function Ue(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function Ve(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function pe(){this.value=void 0}fu