{"size": 18871, "ext": "js", "max_stars_repo_path": "dist/aias.iife.min.js", "max_stars_repo_name": "LCluber/Aias.js", "max_stars_repo_stars_event_min_datetime": "2021-01-10T21:58:16.000Z", "max_stars_repo_stars_event_max_datetime": "2021-01-10T21:58:16.000Z", "max_issues_repo_path": "dist/aias.iife.min.js", "max_issues_repo_name": "LCluber/Aias.js", "max_issues_repo_issues_event_min_datetime": "2019-10-27T10:40:05.000Z", "max_issues_repo_issues_event_max_datetime": "2020-02-09T17:03:30.000Z", "max_forks_repo_path": "dist/aias.iife.min.js", "max_forks_repo_name": "LCluber/Aias.js", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 10, "max_forks_count": null, "avg_line_length": 725.8076923077, "max_line_length": 17714, "alphanum_fraction": 0.7293201208}
/** MIT License
* 
* Copyright (c) 2010 Ludovic CLUBER 
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* https://github.com/LCluber/Aias.js
*/

var Aias=function(t){"use strict";function a(t){"@babel/helpers - typeof";return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function e(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&s(t,e)}function o(t){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function c(n){return function(){var t,e=o(n);if(function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()){var r=o(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return i(this,t)}}function f(t){return null!==t&&"object"===a(t)&&!(null!==(e=t)&&e.constructor===Array);var e}function l(){return"undefined"!=typeof window&&(window.AudioContext||window.webkitAudioContext||!1)}function p(t){return Boolean(t&&void 0!==t.length)}function h(){}function y(t){if(!(this instanceof y))throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],T(t,this)}function d(r,n){for(;3===r._state;)r=r._value;0!==r._state?(r._handled=!0,y._immediateFn(function(){var t=1===r._state?n.onFulfilled:n.onRejected;if(null!==t){var e;try{e=t(r._value)}catch(t){return void w(n.promise,t)}b(n.promise,e)}else(1===r._state?b:w)(n.promise,r._value)})):r._deferreds.push(n)}function b(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"===a(t)||"function"==typeof t)){var r=t.then;if(t instanceof y)return e._state=3,e._value=t,void _(e);if("function"==typeof r)return void T((n=r,o=t,function(){n.apply(o,arguments)}),e)}e._state=1,e._value=t,_(e)}catch(t){w(e,t)}var n,o}function w(t,e){t._state=2,t._value=e,_(t)}function _(t){2===t._state&&0===t._deferreds.length&&y._immediateFn(function(){t._handled||y._unhandledRejectionFn(t._value)});for(var e=0,r=t._deferreds.length;e<r;e++)d(t,t._deferreds[e]);t._deferreds=null}function v(t,e,r){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.promise=r}function T(t,e){var r=!1;try{t(function(t){r||(r=!0,b(e,t))},function(t){r||(r=!0,w(e,t))})}catch(t){if(r)return;r=!0,w(e,t)}}function m(t,e){function r(){this.constructor=t}D(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function E(t){return"function"==typeof t}function S(t){setTimeout(function(){throw t},0)}function O(t){return t.reduce(function(t,e){return t.concat(e instanceof U?e.errors:e)},[])}function x(){}function P(t){if(t||(t=Promise),!t)throw new Error("no Promise impl found");return t}var g={GET:{type:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:!1},HEAD:{type:"HEAD",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:!1},POST:{type:"POST",headers:{"Content-Type":"application/json"},data:!0},PUT:{type:"PUT",headers:{"Content-Type":"application/json"},data:!0},DELETE:{type:"DELETE",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:!1},CONNECT:{type:"CONNECT",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:!1},OPTIONS:{type:"OPTIONS",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:!1},TRACE:{type:"TRACE",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:!1},PATCH:{type:"PATCH",headers:{"Content-Type":"application/json"},data:!1}},j=function(){function s(t,e,r,n,o){u(this,s),this.method=t,this.url=e,this.responseType=r,this.async=!0,this.noCache=!1,this.headers=o,this.data=n}return e(s,[{key:"setRequestHeaders",value:function(t){var e=Object.assign(Object.assign({},g[this.method].headers),this.headers);for(var r in e)e.hasOwnProperty(r)&&""===e[r]&&delete e[r];for(var n in e)e.hasOwnProperty(n)&&t.setRequestHeader(n,e[n])}}]),s}(),A=setTimeout;y.prototype.catch=function(t){return this.then(null,t)},y.prototype.then=function(t,e){var r=new this.constructor(h);return d(this,new v(t,e,r)),r},y.prototype.finally=function(e){var r=this.constructor;return this.then(function(t){return r.resolve(e()).then(function(){return t})},function(t){return r.resolve(e()).then(function(){return r.reject(t)})})},y.all=function(e){return new y(function(n,o){function s(e,t){try{if(t&&("object"===a(t)||"function"==typeof t)){var r=t.then;if("function"==typeof r)return void r.call(t,function(t){s(e,t)},o)}i[e]=t,0==--u&&n(i)}catch(t){o(t)}}if(!p(e))return o(new TypeError("Promise.all accepts an array"));var i=Array.prototype.slice.call(e);if(0===i.length)return n([]);for(var u=i.length,t=0;t<i.length;t++)s(t,i[t])})},y.resolve=function(e){return e&&"object"===a(e)&&e.constructor===y?e:new y(function(t){t(e)})},y.reject=function(r){return new y(function(t,e){e(r)})},y.race=function(o){return new y(function(t,e){if(!p(o))return e(new TypeError("Promise.race accepts an array"));for(var r=0,n=o.length;r<n;r++)y.resolve(o[r]).then(t,e)})},y._immediateFn="function"==typeof setImmediate&&function(t){setImmediate(t)}||function(t){A(t,0)},y._unhandledRejectionFn=function(){"undefined"!=typeof console&&console};var C=l(),H=function(){function s(t,e,r,n,o){return u(this,s),i.call(this,t,e,r,n,o)}r(s,j);var i=c(s);return e(s,[{key:"call",value:function(){var s=this;return new y(function(r,n){var o=new XMLHttpRequest;switch(s.url+=s.noCache?"?cache="+(new Date).getTime():"",o.open(s.method,s.url,s.async),o.responseType="audiobuffer"===s.responseType?"arraybuffer":s.responseType,s.setRequestHeaders(o),s.responseType){case"json":case"arraybuffer":case"audiobuffer":case"blob":o.onload=function(){if(4==o.readyState)if(200==o.status){var t=o.response;if(t)if("audiobuffer"===s.responseType)if(C){var e=new C;e.decodeAudioData(t,function(t){e.close(),r(t)},function(t){e.close(),n({status:t.name,statusText:t.message})})}else n({status:"Web Audio API not supported by your browser",statusText:"Web Audio API is not supported by your browser"});else r(t);else n({status:o.status,statusText:o.statusText})}else n({status:o.status,statusText:o.statusText})};break;default:o.onreadystatechange=function(){4==o.readyState&&(200==o.status?r(o.responseText):n({status:o.status,statusText:o.statusText}))}}f(s.data)&&(s.data=JSON.stringify(s.data)),o.send(s.data||null)})}}]),s}(),D=function(t,e){return(D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},R=!1,N={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t);R=t},get useDeprecatedSynchronousErrorHandling(){return R}},k={closed:!0,next:function(){},error:function(t){if(N.useDeprecatedSynchronousErrorHandling)throw t;S(t)},complete:function(){}},I=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}(),U=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n  "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),F=function(){function c(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var t;return c.prototype.unsubscribe=function(){var e;if(!this.closed){var t,r=this._parentOrParents,n=this._unsubscribe,o=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,r instanceof c)r.remove(this);else if(null!==r)for(var s=0;s<r.length;++s){r[s].remove(this)}if(E(n))try{n.call(this)}catch(t){e=t instanceof U?O(t.errors):[t]}if(I(o)){s=-1;for(var i=o.length;++s<i;){var u=o[s];if(null!==(t=u)&&"object"===a(t))try{u.unsubscribe()}catch(t){e=e||[],t instanceof U?e=e.concat(O(t.errors)):e.push(t)}}}if(e)throw new U(e)}},c.prototype.add=function(t){var e=t;if(!t)return c.EMPTY;switch(a(t)){case"function":e=new c(t);case"object":if(e===this||e.closed||"function"!=typeof e.unsubscribe)return e;if(this.closed)return e.unsubscribe(),e;if(!(e instanceof c)){var r=e;(e=new c)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var n=e._parentOrParents;if(null===n)e._parentOrParents=this;else if(n instanceof c){if(n===this)return e;e._parentOrParents=[n,this]}else{if(-1!==n.indexOf(this))return e;n.push(this)}var o=this._subscriptions;return null===o?this._subscriptions=[e]:o.push(e),e},c.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},c.EMPTY=((t=new c).closed=!0,t),c}(),M=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),q=function(o){function s(t,e,r){var n=o.call(this)||this;switch(n.syncErrorValue=null,n.syncErrorThrown=!1,n.syncErrorThrowable=!1,n.isStopped=!1,arguments.length){case 0:n.destination=k;break;case 1:if(!t){n.destination=k;break}if("object"===a(t)){t instanceof s?(n.syncErrorThrowable=t.syncErrorThrowable,(n.destination=t).add(n)):(n.syncErrorThrowable=!0,n.destination=new L(n,t));break}default:n.syncErrorThrowable=!0,n.destination=new L(n,t,e,r)}return n}return m(s,o),s.prototype[M]=function(){return this},s.create=function(t,e,r){var n=new s(t,e,r);return n.syncErrorThrowable=!1,n},s.prototype.next=function(t){this.isStopped||this._next(t)},s.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},s.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},s.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,o.prototype.unsubscribe.call(this))},s.prototype._next=function(t){this.destination.next(t)},s.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},s.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},s.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},s}(F),L=function(u){function t(t,e,r,n){var o,s=u.call(this)||this;s._parentSubscriber=t;var i=s;return E(e)?o=e:e&&(o=e.next,r=e.error,n=e.complete,e!==k&&(E((i=Object.create(e)).unsubscribe)&&s.add(i.unsubscribe.bind(i)),i.unsubscribe=s.unsubscribe.bind(s))),s._context=i,s._next=o,s._error=r,s._complete=n,s}return m(t,u),t.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;N.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},t.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber,r=N.useDeprecatedSynchronousErrorHandling;if(this._error)r&&e.syncErrorThrowable?this.__tryOrSetError(e,this._error,t):this.__tryOrUnsub(this._error,t),this.unsubscribe();else if(e.syncErrorThrowable)r?(e.syncErrorValue=t,e.syncErrorThrown=!0):S(t),this.unsubscribe();else{if(this.unsubscribe(),r)throw t;S(t)}}},t.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};N.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,r):this.__tryOrUnsub(r),this.unsubscribe()}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(t){if(this.unsubscribe(),N.useDeprecatedSynchronousErrorHandling)throw t;S(t)}},t.prototype.__tryOrSetError=function(e,t,r){if(!N.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{t.call(this._context,r)}catch(t){return N.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0):(S(t),!0)}return!1},t.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},t}(q),V=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}(),G=function(){function r(t){this._isScalar=!1,t&&(this._subscribe=t)}return r.prototype.lift=function(t){var e=new r;return e.source=this,e.operator=t,e},r.prototype.subscribe=function(t,e,r){var n=this.operator,o=function(t,e,r){if(t){if(t instanceof q)return t;if(t[M])return t[M]()}return t||e||r?new q(t,e,r):new q(k)}(t,e,r);if(n?o.add(n.call(o,this.source)):o.add(this.source||N.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),N.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},r.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){N.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),function(t){for(;t;){var e=t,r=e.closed,n=e.destination,o=e.isStopped;if(r||o)return!1;t=n&&n instanceof q?n:null}return!0}(e)&&e.error(t)}},r.prototype.forEach=function(n,t){var o=this;return new(t=P(t))(function(t,e){var r;r=o.subscribe(function(t){try{n(t)}catch(t){e(t),r&&r.unsubscribe()}},e,t)})},r.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},r.prototype[V]=function(){return this},r.prototype.pipe=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 0===t.length?this:((e=t)?1===e.length?e[0]:function(t){return e.reduce(function(t,e){return e(t)},t)}:x)(this)},r.prototype.toPromise=function(t){var n=this;return new(t=P(t))(function(t,e){var r;n.subscribe(function(t){return r=t},function(t){return e(t)},function(){return t(r)})})},r.create=function(t){return new r(t)},r}(),W=l(),J=function(){function s(t,e,r,n,o){return u(this,s),i.call(this,t,e,r,n,o)}r(s,j);var i=c(s);return e(s,[{key:"call",value:function(){var o=this;return new G(function(r){var n=new XMLHttpRequest;switch(o.url+=o.noCache?"?cache="+(new Date).getTime():"",n.open(o.method,o.url,o.async),n.responseType="audiobuffer"===o.responseType?"arraybuffer":o.responseType,o.setRequestHeaders(n),o.responseType){case"json":case"arraybuffer":case"audiobuffer":case"blob":n.onload=function(){if(4==n.readyState)if(200==n.status){var t=n.response;if(t)if("audiobuffer"===o.responseType)if(W){var e=new W;e.decodeAudioData(t,function(t){e.close(),r.next(t),r.complete()},function(t){e.close(),r.error({status:t.name,statusText:t.message}),r.complete()})}else r.error({status:"Web Audio API not supported by your browser",statusText:"Web Audio API is not supported by your browser"}),r.complete();else r.next(t),r.complete();else r.error({status:n.status,statusText:n.statusText}),r.complete()}else r.error({status:n.status,statusText:n.statusText}),r.complete()};break;default:n.onreadystatechange=function(){4==n.readyState&&(200==n.status?r.next(n.responseText):r.error({status:n.status,statusText:n.statusText}),r.complete())}}f(o.data)&&(o.data=JSON.stringify(o.data)),n.send(o.data||null)})}}]),s}();Array.prototype.includes||Object.defineProperty(Array.prototype,"includes",{value:function(t,e){if(null==this)throw new TypeError('"this" is null or not defined');var r,n,o=Object(this),s=o.length>>>0;if(0===s)return!1;for(var i=0|e,u=Math.max(0<=i?i:s-Math.abs(i),0);u<s;){if((r=o[u])===(n=t)||"number"==typeof r&&"number"==typeof n&&isNaN(r)&&isNaN(n))return!0;u++}return!1}});var X=function(){function t(){u(this,t)}return e(t,null,[{key:"setHeaders",value:function(t,e){if(g.hasOwnProperty(t))for(var r in e)e.hasOwnProperty(r)&&(""!==e[r]?g[t].headers[r]=e[r]:delete g[t].headers[r])}}]),t}();return X.observable={get:function(t,e,r){return new J(g.GET.type,t,e,null,r).call()},head:function(t,e,r){return new J(g.HEAD.type,t,e,null,r).call()},post:function(t,e,r,n){return new J(g.POST.type,t,e,r,n).call()},put:function(t,e,r,n){return new J(g.PUT.type,t,e,r,n).call()},delete:function(t,e,r){return new J(g.DELETE.type,t,e,null,r).call()},connect:function(t,e,r){return new J(g.CONNECT.type,t,e,null,r).call()},options:function(t,e,r){return new J(g.OPTIONS.type,t,e,null,r).call()},trace:function(t,e,r){return new J(g.TRACE.type,t,e,null,r).call()},patch:function(t,e,r,n){return new J(g.PATCH.type,t,e,r,n).call()}},X.promise={get:function(t,e,r){return new H(g.GET.type,t,e,null,r).call()},head:function(t,e,r){return new H(g.HEAD.type,t,e,null,r).call()},post:function(t,e,r,n){return new H(g.POST.type,t,e,r,n).call()},put:function(t,e,r,n){return new H(g.PUT.type,t,e,r,n).call()},delete:function(t,e,r){return new H(g.DELETE.type,t,e,null,r).call()},connect:function(t,e,r){return new H(g.CONNECT.type,t,e,null,r).call()},options:function(t,e,r){return new H(g.OPTIONS.type,t,e,null,r).call()},trace:function(t,e,r){return new H(g.TRACE.type,t,e,null,r).call()},patch:function(t,e,r,n){return new H(g.PATCH.type,t,e,r,n).call()}},t.HTTP=X,t}({});