{"ast":null,"code":"'use strict'; //This file contains the ES6 extensions to the core Promises/A+ API\n\nvar Promise = require('./core.js');\n\nmodule.exports = Promise;\n/* Static Functions */\n\nvar TRUE = valuePromise(true);\nvar FALSE = valuePromise(false);\nvar NULL = valuePromise(null);\nvar UNDEFINED = valuePromise(undefined);\nvar ZERO = valuePromise(0);\nvar EMPTYSTRING = valuePromise('');\n\nfunction valuePromise(value) {\n var p = new Promise(Promise._0);\n p._V = 1;\n p._W = value;\n return p;\n}\n\nPromise.resolve = function (value) {\n if (value instanceof Promise) return value;\n if (value === null) return NULL;\n if (value === undefined) return UNDEFINED;\n if (value === true) return TRUE;\n if (value === false) return FALSE;\n if (value === 0) return ZERO;\n if (value === '') return EMPTYSTRING;\n\n if (typeof value === 'object' || typeof value === 'function') {\n try {\n var then = value.then;\n\n if (typeof then === 'function') {\n return new Promise(then.bind(value));\n }\n } catch (ex) {\n return new Promise(function (resolve, reject) {\n reject(ex);\n });\n }\n }\n\n return valuePromise(value);\n};\n\nvar _iterableToArray = function iterableToArray(iterable) {\n if (typeof Array.from === 'function') {\n // ES2015+, iterables exist\n _iterableToArray = Array.from;\n return Array.from(iterable);\n } // ES5, only arrays and array-likes exist\n\n\n _iterableToArray = function iterableToArray(x) {\n return Array.prototype.slice.call(x);\n };\n\n return Array.prototype.slice.call(iterable);\n};\n\nPromise.all = function (arr) {\n var args = _iterableToArray(arr);\n\n return new Promise(function (resolve, reject) {\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n if (val instanceof Promise && val.then === Promise.prototype.then) {\n while (val._V === 3) {\n val = val._W;\n }\n\n if (val._V === 1) return res(i, val._W);\n if (val._V === 2) reject(val._W);\n val.then(function (val) {\n res(i, val);\n }, reject);\n return;\n } else {\n var then = val.then;\n\n if (typeof then === 'function') {\n var p = new Promise(then.bind(val));\n p.then(function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n }\n\n args[i] = val;\n\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.reject = function (value) {\n return new Promise(function (resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function (values) {\n return new Promise(function (resolve, reject) {\n _iterableToArray(values).forEach(function (value) {\n Promise.resolve(value).then(resolve, reject);\n });\n });\n};\n/* Prototype Methods */\n\n\nPromise.prototype['catch'] = function (onRejected) {\n return this.then(null, onRejected);\n};","map":{"version":3,"names":["Promise","require","module","exports","TRUE","valuePromise","FALSE","NULL","UNDEFINED","undefined","ZERO","EMPTYSTRING","value","p","_0","_V","_W","resolve","then","bind","ex","reject","iterableToArray","iterable","Array","from","x","prototype","slice","call","all","arr","args","length","remaining","res","i","val","race","values","forEach","onRejected"],"sources":["/Users/paolasanchez/Desktop/Pry4/Katoikia/katoikia-app/web-ui/sakai-react/node_modules/promise/lib/es6-extensions.js"],"sourcesContent":["'use strict';\n\n//This file contains the ES6 extensions to the core Promises/A+ API\n\nvar Promise = require('./core.js');\n\nmodule.exports = Promise;\n\n/* Static Functions */\n\nvar TRUE = valuePromise(true);\nvar FALSE = valuePromise(false);\nvar NULL = valuePromise(null);\nvar UNDEFINED = valuePromise(undefined);\nvar ZERO = valuePromise(0);\nvar EMPTYSTRING = valuePromise('');\n\nfunction valuePromise(value) {\n var p = new Promise(Promise._0);\n p._V = 1;\n p._W = value;\n return p;\n}\nPromise.resolve = function (value) {\n if (value instanceof Promise) return value;\n\n if (value === null) return NULL;\n if (value === undefined) return UNDEFINED;\n if (value === true) return TRUE;\n if (value === false) return FALSE;\n if (value === 0) return ZERO;\n if (value === '') return EMPTYSTRING;\n\n if (typeof value === 'object' || typeof value === 'function') {\n try {\n var then = value.then;\n if (typeof then === 'function') {\n return new Promise(then.bind(value));\n }\n } catch (ex) {\n return new Promise(function (resolve, reject) {\n reject(ex);\n });\n }\n }\n return valuePromise(value);\n};\n\nvar iterableToArray = function (iterable) {\n if (typeof Array.from === 'function') {\n // ES2015+, iterables exist\n iterableToArray = Array.from;\n return Array.from(iterable);\n }\n\n // ES5, only arrays and array-likes exist\n iterableToArray = function (x) { return Array.prototype.slice.call(x); };\n return Array.prototype.slice.call(iterable);\n}\n\nPromise.all = function (arr) {\n var args = iterableToArray(arr);\n\n return new Promise(function (resolve, reject) {\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n if (val instanceof Promise && val.then === Promise.prototype.then) {\n while (val._V === 3) {\n val = val._W;\n }\n if (val._V === 1) return res(i, val._W);\n if (val._V === 2) reject(val._W);\n val.then(function (val) {\n res(i, val);\n }, reject);\n return;\n } else {\n var then = val.then;\n if (typeof then === 'function') {\n var p = new Promise(then.bind(val));\n p.then(function (val) {\n res(i, val);\n }, reject);\n return;\n }\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n }\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.reject = function (value) {\n return new Promise(function (resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function (values) {\n return new Promise(function (resolve, reject) {\n iterableToArray(values).forEach(function(value){\n Promise.resolve(value).then(resolve, reject);\n });\n });\n};\n\n/* Prototype Methods */\n\nPromise.prototype['catch'] = function (onRejected) {\n return this.then(null, onRejected);\n};\n"],"mappings":"AAAA,a,CAEA;;AAEA,IAAIA,OAAO,GAAGC,OAAO,CAAC,WAAD,CAArB;;AAEAC,MAAM,CAACC,OAAP,GAAiBH,OAAjB;AAEA;;AAEA,IAAII,IAAI,GAAGC,YAAY,CAAC,IAAD,CAAvB;AACA,IAAIC,KAAK,GAAGD,YAAY,CAAC,KAAD,CAAxB;AACA,IAAIE,IAAI,GAAGF,YAAY,CAAC,IAAD,CAAvB;AACA,IAAIG,SAAS,GAAGH,YAAY,CAACI,SAAD,CAA5B;AACA,IAAIC,IAAI,GAAGL,YAAY,CAAC,CAAD,CAA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