Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Promise = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
  2. (function (global){
  3. 'use strict';
  4. var Mutation = global.MutationObserver || global.WebKitMutationObserver;
  5. var scheduleDrain;
  6. {
  7. if (Mutation) {
  8. var called = 0;
  9. var observer = new Mutation(nextTick);
  10. var element = global.document.createTextNode('');
  11. observer.observe(element, {
  12. characterData: true
  13. });
  14. scheduleDrain = function () {
  15. element.data = (called = ++called % 2);
  16. };
  17. } else if (!global.setImmediate && typeof global.MessageChannel !== 'undefined') {
  18. var channel = new global.MessageChannel();
  19. channel.port1.onmessage = nextTick;
  20. scheduleDrain = function () {
  21. channel.port2.postMessage(0);
  22. };
  23. } else if ('document' in global && 'onreadystatechange' in global.document.createElement('script')) {
  24. scheduleDrain = function () {
  25. // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
  26. // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
  27. var scriptEl = global.document.createElement('script');
  28. scriptEl.onreadystatechange = function () {
  29. nextTick();
  30. scriptEl.onreadystatechange = null;
  31. scriptEl.parentNode.removeChild(scriptEl);
  32. scriptEl = null;
  33. };
  34. global.document.documentElement.appendChild(scriptEl);
  35. };
  36. } else {
  37. scheduleDrain = function () {
  38. setTimeout(nextTick, 0);
  39. };
  40. }
  41. }
  42. var draining;
  43. var queue = [];
  44. //named nextTick for less confusing stack traces
  45. function nextTick() {
  46. draining = true;
  47. var i, oldQueue;
  48. var len = queue.length;
  49. while (len) {
  50. oldQueue = queue;
  51. queue = [];
  52. i = -1;
  53. while (++i < len) {
  54. oldQueue[i]();
  55. }
  56. len = queue.length;
  57. }
  58. draining = false;
  59. }
  60. module.exports = immediate;
  61. function immediate(task) {
  62. if (queue.push(task) === 1 && !draining) {
  63. scheduleDrain();
  64. }
  65. }
  66. }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  67. },{}],2:[function(_dereq_,module,exports){
  68. 'use strict';
  69. var immediate = _dereq_(1);
  70. /* istanbul ignore next */
  71. function INTERNAL() {}
  72. var handlers = {};
  73. var REJECTED = ['REJECTED'];
  74. var FULFILLED = ['FULFILLED'];
  75. var PENDING = ['PENDING'];
  76. module.exports = Promise;
  77. function Promise(resolver) {
  78. if (typeof resolver !== 'function') {
  79. throw new TypeError('resolver must be a function');
  80. }
  81. this.state = PENDING;
  82. this.queue = [];
  83. this.outcome = void 0;
  84. if (resolver !== INTERNAL) {
  85. safelyResolveThenable(this, resolver);
  86. }
  87. }
  88. Promise.prototype["catch"] = function (onRejected) {
  89. return this.then(null, onRejected);
  90. };
  91. Promise.prototype.then = function (onFulfilled, onRejected) {
  92. if (typeof onFulfilled !== 'function' && this.state === FULFILLED ||
  93. typeof onRejected !== 'function' && this.state === REJECTED) {
  94. return this;
  95. }
  96. var promise = new this.constructor(INTERNAL);
  97. if (this.state !== PENDING) {
  98. var resolver = this.state === FULFILLED ? onFulfilled : onRejected;
  99. unwrap(promise, resolver, this.outcome);
  100. } else {
  101. this.queue.push(new QueueItem(promise, onFulfilled, onRejected));
  102. }
  103. return promise;
  104. };
  105. function QueueItem(promise, onFulfilled, onRejected) {
  106. this.promise = promise;
  107. if (typeof onFulfilled === 'function') {
  108. this.onFulfilled = onFulfilled;
  109. this.callFulfilled = this.otherCallFulfilled;
  110. }
  111. if (typeof onRejected === 'function') {
  112. this.onRejected = onRejected;
  113. this.callRejected = this.otherCallRejected;
  114. }
  115. }
  116. QueueItem.prototype.callFulfilled = function (value) {
  117. handlers.resolve(this.promise, value);
  118. };
  119. QueueItem.prototype.otherCallFulfilled = function (value) {
  120. unwrap(this.promise, this.onFulfilled, value);
  121. };
  122. QueueItem.prototype.callRejected = function (value) {
  123. handlers.reject(this.promise, value);
  124. };
  125. QueueItem.prototype.otherCallRejected = function (value) {
  126. unwrap(this.promise, this.onRejected, value);
  127. };
  128. function unwrap(promise, func, value) {
  129. immediate(function () {
  130. var returnValue;
  131. try {
  132. returnValue = func(value);
  133. } catch (e) {
  134. return handlers.reject(promise, e);
  135. }
  136. if (returnValue === promise) {
  137. handlers.reject(promise, new TypeError('Cannot resolve promise with itself'));
  138. } else {
  139. handlers.resolve(promise, returnValue);
  140. }
  141. });
  142. }
  143. handlers.resolve = function (self, value) {
  144. var result = tryCatch(getThen, value);
  145. if (result.status === 'error') {
  146. return handlers.reject(self, result.value);
  147. }
  148. var thenable = result.value;
  149. if (thenable) {
  150. safelyResolveThenable(self, thenable);
  151. } else {
  152. self.state = FULFILLED;
  153. self.outcome = value;
  154. var i = -1;
  155. var len = self.queue.length;
  156. while (++i < len) {
  157. self.queue[i].callFulfilled(value);
  158. }
  159. }
  160. return self;
  161. };
  162. handlers.reject = function (self, error) {
  163. self.state = REJECTED;
  164. self.outcome = error;
  165. var i = -1;
  166. var len = self.queue.length;
  167. while (++i < len) {
  168. self.queue[i].callRejected(error);
  169. }
  170. return self;
  171. };
  172. function getThen(obj) {
  173. // Make sure we only access the accessor once as required by the spec
  174. var then = obj && obj.then;
  175. if (obj && (typeof obj === 'object' || typeof obj === 'function') && typeof then === 'function') {
  176. return function appyThen() {
  177. then.apply(obj, arguments);
  178. };
  179. }
  180. }
  181. function safelyResolveThenable(self, thenable) {
  182. // Either fulfill, reject or reject with error
  183. var called = false;
  184. function onError(value) {
  185. if (called) {
  186. return;
  187. }
  188. called = true;
  189. handlers.reject(self, value);
  190. }
  191. function onSuccess(value) {
  192. if (called) {
  193. return;
  194. }
  195. called = true;
  196. handlers.resolve(self, value);
  197. }
  198. function tryToUnwrap() {
  199. thenable(onSuccess, onError);
  200. }
  201. var result = tryCatch(tryToUnwrap);
  202. if (result.status === 'error') {
  203. onError(result.value);
  204. }
  205. }
  206. function tryCatch(func, value) {
  207. var out = {};
  208. try {
  209. out.value = func(value);
  210. out.status = 'success';
  211. } catch (e) {
  212. out.status = 'error';
  213. out.value = e;
  214. }
  215. return out;
  216. }
  217. Promise.resolve = resolve;
  218. function resolve(value) {
  219. if (value instanceof this) {
  220. return value;
  221. }
  222. return handlers.resolve(new this(INTERNAL), value);
  223. }
  224. Promise.reject = reject;
  225. function reject(reason) {
  226. var promise = new this(INTERNAL);
  227. return handlers.reject(promise, reason);
  228. }
  229. Promise.all = all;
  230. function all(iterable) {
  231. var self = this;
  232. if (Object.prototype.toString.call(iterable) !== '[object Array]') {
  233. return this.reject(new TypeError('must be an array'));
  234. }
  235. var len = iterable.length;
  236. var called = false;
  237. if (!len) {
  238. return this.resolve([]);
  239. }
  240. var values = new Array(len);
  241. var resolved = 0;
  242. var i = -1;
  243. var promise = new this(INTERNAL);
  244. while (++i < len) {
  245. allResolver(iterable[i], i);
  246. }
  247. return promise;
  248. function allResolver(value, i) {
  249. self.resolve(value).then(resolveFromAll, function (error) {
  250. if (!called) {
  251. called = true;
  252. handlers.reject(promise, error);
  253. }
  254. });
  255. function resolveFromAll(outValue) {
  256. values[i] = outValue;
  257. if (++resolved === len && !called) {
  258. called = true;
  259. handlers.resolve(promise, values);
  260. }
  261. }
  262. }
  263. }
  264. Promise.race = race;
  265. function race(iterable) {
  266. var self = this;
  267. if (Object.prototype.toString.call(iterable) !== '[object Array]') {
  268. return this.reject(new TypeError('must be an array'));
  269. }
  270. var len = iterable.length;
  271. var called = false;
  272. if (!len) {
  273. return this.resolve([]);
  274. }
  275. var i = -1;
  276. var promise = new this(INTERNAL);
  277. while (++i < len) {
  278. resolver(iterable[i]);
  279. }
  280. return promise;
  281. function resolver(value) {
  282. self.resolve(value).then(function (response) {
  283. if (!called) {
  284. called = true;
  285. handlers.resolve(promise, response);
  286. }
  287. }, function (error) {
  288. if (!called) {
  289. called = true;
  290. handlers.reject(promise, error);
  291. }
  292. });
  293. }
  294. }
  295. },{"1":1}]},{},[2])(2)
  296. });