a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. /**
  2. * @license Angular v5.2.11
  3. * (c) 2010-2018 Google, Inc. https://angular.io/
  4. * License: MIT
  5. */
  6. import { EventEmitter, Injectable } from '@angular/core';
  7. import { __extends } from 'tslib';
  8. import { LocationStrategy } from '@angular/common';
  9. /**
  10. * @fileoverview added by tsickle
  11. * @suppress {checkTypes} checked by tsc
  12. */
  13. /**
  14. * @license
  15. * Copyright Google Inc. All Rights Reserved.
  16. *
  17. * Use of this source code is governed by an MIT-style license that can be
  18. * found in the LICENSE file at https://angular.io/license
  19. */
  20. /**
  21. * A spy for {\@link Location} that allows tests to fire simulated location events.
  22. *
  23. * \@experimental
  24. */
  25. var SpyLocation = /** @class */ (function () {
  26. function SpyLocation() {
  27. this.urlChanges = [];
  28. this._history = [new LocationState('', '')];
  29. this._historyIndex = 0;
  30. /**
  31. * \@internal
  32. */
  33. this._subject = new EventEmitter();
  34. /**
  35. * \@internal
  36. */
  37. this._baseHref = '';
  38. /**
  39. * \@internal
  40. */
  41. this._platformStrategy = /** @type {?} */ ((null));
  42. }
  43. /**
  44. * @param {?} url
  45. * @return {?}
  46. */
  47. SpyLocation.prototype.setInitialPath = /**
  48. * @param {?} url
  49. * @return {?}
  50. */
  51. function (url) { this._history[this._historyIndex].path = url; };
  52. /**
  53. * @param {?} url
  54. * @return {?}
  55. */
  56. SpyLocation.prototype.setBaseHref = /**
  57. * @param {?} url
  58. * @return {?}
  59. */
  60. function (url) { this._baseHref = url; };
  61. /**
  62. * @return {?}
  63. */
  64. SpyLocation.prototype.path = /**
  65. * @return {?}
  66. */
  67. function () { return this._history[this._historyIndex].path; };
  68. /**
  69. * @param {?} path
  70. * @param {?=} query
  71. * @return {?}
  72. */
  73. SpyLocation.prototype.isCurrentPathEqualTo = /**
  74. * @param {?} path
  75. * @param {?=} query
  76. * @return {?}
  77. */
  78. function (path, query) {
  79. if (query === void 0) { query = ''; }
  80. var /** @type {?} */ givenPath = path.endsWith('/') ? path.substring(0, path.length - 1) : path;
  81. var /** @type {?} */ currPath = this.path().endsWith('/') ? this.path().substring(0, this.path().length - 1) : this.path();
  82. return currPath == givenPath + (query.length > 0 ? ('?' + query) : '');
  83. };
  84. /**
  85. * @param {?} pathname
  86. * @return {?}
  87. */
  88. SpyLocation.prototype.simulateUrlPop = /**
  89. * @param {?} pathname
  90. * @return {?}
  91. */
  92. function (pathname) {
  93. this._subject.emit({ 'url': pathname, 'pop': true, 'type': 'popstate' });
  94. };
  95. /**
  96. * @param {?} pathname
  97. * @return {?}
  98. */
  99. SpyLocation.prototype.simulateHashChange = /**
  100. * @param {?} pathname
  101. * @return {?}
  102. */
  103. function (pathname) {
  104. // Because we don't prevent the native event, the browser will independently update the path
  105. this.setInitialPath(pathname);
  106. this.urlChanges.push('hash: ' + pathname);
  107. this._subject.emit({ 'url': pathname, 'pop': true, 'type': 'hashchange' });
  108. };
  109. /**
  110. * @param {?} url
  111. * @return {?}
  112. */
  113. SpyLocation.prototype.prepareExternalUrl = /**
  114. * @param {?} url
  115. * @return {?}
  116. */
  117. function (url) {
  118. if (url.length > 0 && !url.startsWith('/')) {
  119. url = '/' + url;
  120. }
  121. return this._baseHref + url;
  122. };
  123. /**
  124. * @param {?} path
  125. * @param {?=} query
  126. * @return {?}
  127. */
  128. SpyLocation.prototype.go = /**
  129. * @param {?} path
  130. * @param {?=} query
  131. * @return {?}
  132. */
  133. function (path, query) {
  134. if (query === void 0) { query = ''; }
  135. path = this.prepareExternalUrl(path);
  136. if (this._historyIndex > 0) {
  137. this._history.splice(this._historyIndex + 1);
  138. }
  139. this._history.push(new LocationState(path, query));
  140. this._historyIndex = this._history.length - 1;
  141. var /** @type {?} */ locationState = this._history[this._historyIndex - 1];
  142. if (locationState.path == path && locationState.query == query) {
  143. return;
  144. }
  145. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  146. this.urlChanges.push(url);
  147. this._subject.emit({ 'url': url, 'pop': false });
  148. };
  149. /**
  150. * @param {?} path
  151. * @param {?=} query
  152. * @return {?}
  153. */
  154. SpyLocation.prototype.replaceState = /**
  155. * @param {?} path
  156. * @param {?=} query
  157. * @return {?}
  158. */
  159. function (path, query) {
  160. if (query === void 0) { query = ''; }
  161. path = this.prepareExternalUrl(path);
  162. var /** @type {?} */ history = this._history[this._historyIndex];
  163. if (history.path == path && history.query == query) {
  164. return;
  165. }
  166. history.path = path;
  167. history.query = query;
  168. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  169. this.urlChanges.push('replace: ' + url);
  170. };
  171. /**
  172. * @return {?}
  173. */
  174. SpyLocation.prototype.forward = /**
  175. * @return {?}
  176. */
  177. function () {
  178. if (this._historyIndex < (this._history.length - 1)) {
  179. this._historyIndex++;
  180. this._subject.emit({ 'url': this.path(), 'pop': true });
  181. }
  182. };
  183. /**
  184. * @return {?}
  185. */
  186. SpyLocation.prototype.back = /**
  187. * @return {?}
  188. */
  189. function () {
  190. if (this._historyIndex > 0) {
  191. this._historyIndex--;
  192. this._subject.emit({ 'url': this.path(), 'pop': true });
  193. }
  194. };
  195. /**
  196. * @param {?} onNext
  197. * @param {?=} onThrow
  198. * @param {?=} onReturn
  199. * @return {?}
  200. */
  201. SpyLocation.prototype.subscribe = /**
  202. * @param {?} onNext
  203. * @param {?=} onThrow
  204. * @param {?=} onReturn
  205. * @return {?}
  206. */
  207. function (onNext, onThrow, onReturn) {
  208. return this._subject.subscribe({ next: onNext, error: onThrow, complete: onReturn });
  209. };
  210. /**
  211. * @param {?} url
  212. * @return {?}
  213. */
  214. SpyLocation.prototype.normalize = /**
  215. * @param {?} url
  216. * @return {?}
  217. */
  218. function (url) { return /** @type {?} */ ((null)); };
  219. SpyLocation.decorators = [
  220. { type: Injectable },
  221. ];
  222. /** @nocollapse */
  223. SpyLocation.ctorParameters = function () { return []; };
  224. return SpyLocation;
  225. }());
  226. var LocationState = /** @class */ (function () {
  227. function LocationState(path, query) {
  228. this.path = path;
  229. this.query = query;
  230. }
  231. return LocationState;
  232. }());
  233. /**
  234. * @fileoverview added by tsickle
  235. * @suppress {checkTypes} checked by tsc
  236. */
  237. /**
  238. * @license
  239. * Copyright Google Inc. All Rights Reserved.
  240. *
  241. * Use of this source code is governed by an MIT-style license that can be
  242. * found in the LICENSE file at https://angular.io/license
  243. */
  244. /**
  245. * A mock implementation of {\@link LocationStrategy} that allows tests to fire simulated
  246. * location events.
  247. *
  248. * \@stable
  249. */
  250. var MockLocationStrategy = /** @class */ (function (_super) {
  251. __extends(MockLocationStrategy, _super);
  252. function MockLocationStrategy() {
  253. var _this = _super.call(this) || this;
  254. _this.internalBaseHref = '/';
  255. _this.internalPath = '/';
  256. _this.internalTitle = '';
  257. _this.urlChanges = [];
  258. /**
  259. * \@internal
  260. */
  261. _this._subject = new EventEmitter();
  262. return _this;
  263. }
  264. /**
  265. * @param {?} url
  266. * @return {?}
  267. */
  268. MockLocationStrategy.prototype.simulatePopState = /**
  269. * @param {?} url
  270. * @return {?}
  271. */
  272. function (url) {
  273. this.internalPath = url;
  274. this._subject.emit(new _MockPopStateEvent(this.path()));
  275. };
  276. /**
  277. * @param {?=} includeHash
  278. * @return {?}
  279. */
  280. MockLocationStrategy.prototype.path = /**
  281. * @param {?=} includeHash
  282. * @return {?}
  283. */
  284. function (includeHash) {
  285. if (includeHash === void 0) { includeHash = false; }
  286. return this.internalPath;
  287. };
  288. /**
  289. * @param {?} internal
  290. * @return {?}
  291. */
  292. MockLocationStrategy.prototype.prepareExternalUrl = /**
  293. * @param {?} internal
  294. * @return {?}
  295. */
  296. function (internal) {
  297. if (internal.startsWith('/') && this.internalBaseHref.endsWith('/')) {
  298. return this.internalBaseHref + internal.substring(1);
  299. }
  300. return this.internalBaseHref + internal;
  301. };
  302. /**
  303. * @param {?} ctx
  304. * @param {?} title
  305. * @param {?} path
  306. * @param {?} query
  307. * @return {?}
  308. */
  309. MockLocationStrategy.prototype.pushState = /**
  310. * @param {?} ctx
  311. * @param {?} title
  312. * @param {?} path
  313. * @param {?} query
  314. * @return {?}
  315. */
  316. function (ctx, title, path, query) {
  317. this.internalTitle = title;
  318. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  319. this.internalPath = url;
  320. var /** @type {?} */ externalUrl = this.prepareExternalUrl(url);
  321. this.urlChanges.push(externalUrl);
  322. };
  323. /**
  324. * @param {?} ctx
  325. * @param {?} title
  326. * @param {?} path
  327. * @param {?} query
  328. * @return {?}
  329. */
  330. MockLocationStrategy.prototype.replaceState = /**
  331. * @param {?} ctx
  332. * @param {?} title
  333. * @param {?} path
  334. * @param {?} query
  335. * @return {?}
  336. */
  337. function (ctx, title, path, query) {
  338. this.internalTitle = title;
  339. var /** @type {?} */ url = path + (query.length > 0 ? ('?' + query) : '');
  340. this.internalPath = url;
  341. var /** @type {?} */ externalUrl = this.prepareExternalUrl(url);
  342. this.urlChanges.push('replace: ' + externalUrl);
  343. };
  344. /**
  345. * @param {?} fn
  346. * @return {?}
  347. */
  348. MockLocationStrategy.prototype.onPopState = /**
  349. * @param {?} fn
  350. * @return {?}
  351. */
  352. function (fn) { this._subject.subscribe({ next: fn }); };
  353. /**
  354. * @return {?}
  355. */
  356. MockLocationStrategy.prototype.getBaseHref = /**
  357. * @return {?}
  358. */
  359. function () { return this.internalBaseHref; };
  360. /**
  361. * @return {?}
  362. */
  363. MockLocationStrategy.prototype.back = /**
  364. * @return {?}
  365. */
  366. function () {
  367. if (this.urlChanges.length > 0) {
  368. this.urlChanges.pop();
  369. var /** @type {?} */ nextUrl = this.urlChanges.length > 0 ? this.urlChanges[this.urlChanges.length - 1] : '';
  370. this.simulatePopState(nextUrl);
  371. }
  372. };
  373. /**
  374. * @return {?}
  375. */
  376. MockLocationStrategy.prototype.forward = /**
  377. * @return {?}
  378. */
  379. function () { throw 'not implemented'; };
  380. MockLocationStrategy.decorators = [
  381. { type: Injectable },
  382. ];
  383. /** @nocollapse */
  384. MockLocationStrategy.ctorParameters = function () { return []; };
  385. return MockLocationStrategy;
  386. }(LocationStrategy));
  387. var _MockPopStateEvent = /** @class */ (function () {
  388. function _MockPopStateEvent(newUrl) {
  389. this.newUrl = newUrl;
  390. this.pop = true;
  391. this.type = 'popstate';
  392. }
  393. return _MockPopStateEvent;
  394. }());
  395. /**
  396. * @fileoverview added by tsickle
  397. * @suppress {checkTypes} checked by tsc
  398. */
  399. /**
  400. * @license
  401. * Copyright Google Inc. All Rights Reserved.
  402. *
  403. * Use of this source code is governed by an MIT-style license that can be
  404. * found in the LICENSE file at https://angular.io/license
  405. */
  406. /**
  407. * @fileoverview added by tsickle
  408. * @suppress {checkTypes} checked by tsc
  409. */
  410. /**
  411. * @license
  412. * Copyright Google Inc. All Rights Reserved.
  413. *
  414. * Use of this source code is governed by an MIT-style license that can be
  415. * found in the LICENSE file at https://angular.io/license
  416. */
  417. /**
  418. * @module
  419. * @description
  420. * Entry point for all public APIs of this package.
  421. */
  422. // This file only reexports content of the `src` folder. Keep it that way.
  423. /**
  424. * @fileoverview added by tsickle
  425. * @suppress {checkTypes} checked by tsc
  426. */
  427. /**
  428. * Generated bundle index. Do not edit.
  429. */
  430. export { SpyLocation, MockLocationStrategy };
  431. //# sourceMappingURL=testing.js.map