a zip code crypto-currency system good for red ONLY

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  1. /**
  2. * @license Angular v5.2.11
  3. * (c) 2010-2018 Google, Inc. https://angular.io/
  4. * License: MIT
  5. */
  6. import { CompileMetadataResolver, CompileReflector, CompilerConfig, DirectiveNormalizer, DirectiveResolver, DomElementSchemaRegistry, ElementSchemaRegistry, HtmlParser, I18NHtmlParser, Identifiers, JitCompiler, JitSummaryResolver, Lexer, NgModuleCompiler, NgModuleResolver, Parser, PipeResolver, ProviderMeta, ResourceLoader, StaticSymbolCache, StyleCompiler, SummaryResolver, TemplateParser, UrlResolver, ViewCompiler, getUrlScheme, syntaxError } from '@angular/compiler';
  7. import { ANALYZE_FOR_ENTRY_COMPONENTS, COMPILER_OPTIONS, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, ComponentFactory, ComponentFactoryResolver, ComponentRef, ElementRef, Inject, Injectable, InjectionToken, Injector, LOCALE_ID, MissingTranslationStrategy, NgModuleFactory, NgModuleRef, Optional, PACKAGE_ROOT_URL, PLATFORM_ID, QueryList, Renderer, SecurityContext, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Version, ViewContainerRef, ViewEncapsulation, createPlatformFactory, isDevMode, platformCore, ɵCodegenComponentFactoryResolver, ɵConsole, ɵEMPTY_ARRAY, ɵEMPTY_MAP, ɵReflectionCapabilities, ɵand, ɵccf, ɵcmf, ɵcrt, ɵdid, ɵeld, ɵglobal, ɵinlineInterpolate, ɵinterpolate, ɵmod, ɵmpd, ɵncd, ɵnov, ɵpad, ɵpid, ɵpod, ɵppd, ɵprd, ɵqud, ɵregisterModuleFactory, ɵstringify, ɵted, ɵunv, ɵvid } from '@angular/core';
  8. import { ɵPLATFORM_BROWSER_ID } from '@angular/common';
  9. import { ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS } from '@angular/platform-browser';
  10. import { __extends } from 'tslib';
  11. /**
  12. * @fileoverview added by tsickle
  13. * @suppress {checkTypes} checked by tsc
  14. */
  15. /**
  16. * @license
  17. * Copyright Google Inc. All Rights Reserved.
  18. *
  19. * Use of this source code is governed by an MIT-style license that can be
  20. * found in the LICENSE file at https://angular.io/license
  21. */
  22. var MODULE_SUFFIX = '';
  23. var builtinExternalReferences = createBuiltinExternalReferencesMap();
  24. var JitReflector = /** @class */ (function () {
  25. function JitReflector() {
  26. this.builtinExternalReferences = new Map();
  27. this.reflectionCapabilities = new ɵReflectionCapabilities();
  28. }
  29. /**
  30. * @param {?} type
  31. * @param {?} cmpMetadata
  32. * @return {?}
  33. */
  34. JitReflector.prototype.componentModuleUrl = /**
  35. * @param {?} type
  36. * @param {?} cmpMetadata
  37. * @return {?}
  38. */
  39. function (type, cmpMetadata) {
  40. var /** @type {?} */ moduleId = cmpMetadata.moduleId;
  41. if (typeof moduleId === 'string') {
  42. var /** @type {?} */ scheme = getUrlScheme(moduleId);
  43. return scheme ? moduleId : "package:" + moduleId + MODULE_SUFFIX;
  44. }
  45. else if (moduleId !== null && moduleId !== void 0) {
  46. throw syntaxError("moduleId should be a string in \"" + ɵstringify(type) + "\". See https://goo.gl/wIDDiL for more information.\n" +
  47. "If you're using Webpack you should inline the template and the styles, see https://goo.gl/X2J8zc.");
  48. }
  49. return "./" + ɵstringify(type);
  50. };
  51. /**
  52. * @param {?} typeOrFunc
  53. * @return {?}
  54. */
  55. JitReflector.prototype.parameters = /**
  56. * @param {?} typeOrFunc
  57. * @return {?}
  58. */
  59. function (typeOrFunc) {
  60. return this.reflectionCapabilities.parameters(typeOrFunc);
  61. };
  62. /**
  63. * @param {?} typeOrFunc
  64. * @return {?}
  65. */
  66. JitReflector.prototype.annotations = /**
  67. * @param {?} typeOrFunc
  68. * @return {?}
  69. */
  70. function (typeOrFunc) {
  71. return this.reflectionCapabilities.annotations(typeOrFunc);
  72. };
  73. /**
  74. * @param {?} typeOrFunc
  75. * @return {?}
  76. */
  77. JitReflector.prototype.propMetadata = /**
  78. * @param {?} typeOrFunc
  79. * @return {?}
  80. */
  81. function (typeOrFunc) {
  82. return this.reflectionCapabilities.propMetadata(typeOrFunc);
  83. };
  84. /**
  85. * @param {?} type
  86. * @param {?} lcProperty
  87. * @return {?}
  88. */
  89. JitReflector.prototype.hasLifecycleHook = /**
  90. * @param {?} type
  91. * @param {?} lcProperty
  92. * @return {?}
  93. */
  94. function (type, lcProperty) {
  95. return this.reflectionCapabilities.hasLifecycleHook(type, lcProperty);
  96. };
  97. /**
  98. * @param {?} type
  99. * @return {?}
  100. */
  101. JitReflector.prototype.guards = /**
  102. * @param {?} type
  103. * @return {?}
  104. */
  105. function (type) { return this.reflectionCapabilities.guards(type); };
  106. /**
  107. * @param {?} ref
  108. * @return {?}
  109. */
  110. JitReflector.prototype.resolveExternalReference = /**
  111. * @param {?} ref
  112. * @return {?}
  113. */
  114. function (ref) {
  115. return builtinExternalReferences.get(ref) || ref.runtime;
  116. };
  117. return JitReflector;
  118. }());
  119. /**
  120. * @return {?}
  121. */
  122. function createBuiltinExternalReferencesMap() {
  123. var /** @type {?} */ map = new Map();
  124. map.set(Identifiers.ANALYZE_FOR_ENTRY_COMPONENTS, ANALYZE_FOR_ENTRY_COMPONENTS);
  125. map.set(Identifiers.ElementRef, ElementRef);
  126. map.set(Identifiers.NgModuleRef, NgModuleRef);
  127. map.set(Identifiers.ViewContainerRef, ViewContainerRef);
  128. map.set(Identifiers.ChangeDetectorRef, ChangeDetectorRef);
  129. map.set(Identifiers.QueryList, QueryList);
  130. map.set(Identifiers.TemplateRef, TemplateRef);
  131. map.set(Identifiers.CodegenComponentFactoryResolver, ɵCodegenComponentFactoryResolver);
  132. map.set(Identifiers.ComponentFactoryResolver, ComponentFactoryResolver);
  133. map.set(Identifiers.ComponentFactory, ComponentFactory);
  134. map.set(Identifiers.ComponentRef, ComponentRef);
  135. map.set(Identifiers.NgModuleFactory, NgModuleFactory);
  136. map.set(Identifiers.createModuleFactory, ɵcmf);
  137. map.set(Identifiers.moduleDef, ɵmod);
  138. map.set(Identifiers.moduleProviderDef, ɵmpd);
  139. map.set(Identifiers.RegisterModuleFactoryFn, ɵregisterModuleFactory);
  140. map.set(Identifiers.Injector, Injector);
  141. map.set(Identifiers.ViewEncapsulation, ViewEncapsulation);
  142. map.set(Identifiers.ChangeDetectionStrategy, ChangeDetectionStrategy);
  143. map.set(Identifiers.SecurityContext, SecurityContext);
  144. map.set(Identifiers.LOCALE_ID, LOCALE_ID);
  145. map.set(Identifiers.TRANSLATIONS_FORMAT, TRANSLATIONS_FORMAT);
  146. map.set(Identifiers.inlineInterpolate, ɵinlineInterpolate);
  147. map.set(Identifiers.interpolate, ɵinterpolate);
  148. map.set(Identifiers.EMPTY_ARRAY, ɵEMPTY_ARRAY);
  149. map.set(Identifiers.EMPTY_MAP, ɵEMPTY_MAP);
  150. map.set(Identifiers.Renderer, Renderer);
  151. map.set(Identifiers.viewDef, ɵvid);
  152. map.set(Identifiers.elementDef, ɵeld);
  153. map.set(Identifiers.anchorDef, ɵand);
  154. map.set(Identifiers.textDef, ɵted);
  155. map.set(Identifiers.directiveDef, ɵdid);
  156. map.set(Identifiers.providerDef, ɵprd);
  157. map.set(Identifiers.queryDef, ɵqud);
  158. map.set(Identifiers.pureArrayDef, ɵpad);
  159. map.set(Identifiers.pureObjectDef, ɵpod);
  160. map.set(Identifiers.purePipeDef, ɵppd);
  161. map.set(Identifiers.pipeDef, ɵpid);
  162. map.set(Identifiers.nodeValue, ɵnov);
  163. map.set(Identifiers.ngContentDef, ɵncd);
  164. map.set(Identifiers.unwrapValue, ɵunv);
  165. map.set(Identifiers.createRendererType2, ɵcrt);
  166. map.set(Identifiers.createComponentFactory, ɵccf);
  167. return map;
  168. }
  169. /**
  170. * @fileoverview added by tsickle
  171. * @suppress {checkTypes} checked by tsc
  172. */
  173. /**
  174. * @license
  175. * Copyright Google Inc. All Rights Reserved.
  176. *
  177. * Use of this source code is governed by an MIT-style license that can be
  178. * found in the LICENSE file at https://angular.io/license
  179. */
  180. var ERROR_COLLECTOR_TOKEN = new InjectionToken('ErrorCollector');
  181. /**
  182. * A default provider for {\@link PACKAGE_ROOT_URL} that maps to '/'.
  183. */
  184. var DEFAULT_PACKAGE_URL_PROVIDER = {
  185. provide: PACKAGE_ROOT_URL,
  186. useValue: '/'
  187. };
  188. var _NO_RESOURCE_LOADER = {
  189. get: /**
  190. * @param {?} url
  191. * @return {?}
  192. */
  193. function (url) {
  194. throw new Error("No ResourceLoader implementation has been provided. Can't read the url \"" + url + "\"");
  195. }
  196. };
  197. var baseHtmlParser = new InjectionToken('HtmlParser');
  198. var CompilerImpl = /** @class */ (function () {
  199. function CompilerImpl(injector, _metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console) {
  200. this._metadataResolver = _metadataResolver;
  201. this._delegate = new JitCompiler(_metadataResolver, templateParser, styleCompiler, viewCompiler, ngModuleCompiler, summaryResolver, compileReflector, compilerConfig, console, this.getExtraNgModuleProviders.bind(this));
  202. this.injector = injector;
  203. }
  204. /**
  205. * @return {?}
  206. */
  207. CompilerImpl.prototype.getExtraNgModuleProviders = /**
  208. * @return {?}
  209. */
  210. function () {
  211. return [this._metadataResolver.getProviderMetadata(new ProviderMeta(Compiler, { useValue: this }))];
  212. };
  213. /**
  214. * @template T
  215. * @param {?} moduleType
  216. * @return {?}
  217. */
  218. CompilerImpl.prototype.compileModuleSync = /**
  219. * @template T
  220. * @param {?} moduleType
  221. * @return {?}
  222. */
  223. function (moduleType) {
  224. return /** @type {?} */ (this._delegate.compileModuleSync(moduleType));
  225. };
  226. /**
  227. * @template T
  228. * @param {?} moduleType
  229. * @return {?}
  230. */
  231. CompilerImpl.prototype.compileModuleAsync = /**
  232. * @template T
  233. * @param {?} moduleType
  234. * @return {?}
  235. */
  236. function (moduleType) {
  237. return /** @type {?} */ (this._delegate.compileModuleAsync(moduleType));
  238. };
  239. /**
  240. * @template T
  241. * @param {?} moduleType
  242. * @return {?}
  243. */
  244. CompilerImpl.prototype.compileModuleAndAllComponentsSync = /**
  245. * @template T
  246. * @param {?} moduleType
  247. * @return {?}
  248. */
  249. function (moduleType) {
  250. var /** @type {?} */ result = this._delegate.compileModuleAndAllComponentsSync(moduleType);
  251. return {
  252. ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),
  253. componentFactories: /** @type {?} */ (result.componentFactories),
  254. };
  255. };
  256. /**
  257. * @template T
  258. * @param {?} moduleType
  259. * @return {?}
  260. */
  261. CompilerImpl.prototype.compileModuleAndAllComponentsAsync = /**
  262. * @template T
  263. * @param {?} moduleType
  264. * @return {?}
  265. */
  266. function (moduleType) {
  267. return this._delegate.compileModuleAndAllComponentsAsync(moduleType)
  268. .then(function (result) {
  269. return ({
  270. ngModuleFactory: /** @type {?} */ (result.ngModuleFactory),
  271. componentFactories: /** @type {?} */ (result.componentFactories),
  272. });
  273. });
  274. };
  275. /**
  276. * @param {?} summaries
  277. * @return {?}
  278. */
  279. CompilerImpl.prototype.loadAotSummaries = /**
  280. * @param {?} summaries
  281. * @return {?}
  282. */
  283. function (summaries) { this._delegate.loadAotSummaries(summaries); };
  284. /**
  285. * @param {?} ref
  286. * @return {?}
  287. */
  288. CompilerImpl.prototype.hasAotSummary = /**
  289. * @param {?} ref
  290. * @return {?}
  291. */
  292. function (ref) { return this._delegate.hasAotSummary(ref); };
  293. /**
  294. * @template T
  295. * @param {?} component
  296. * @return {?}
  297. */
  298. CompilerImpl.prototype.getComponentFactory = /**
  299. * @template T
  300. * @param {?} component
  301. * @return {?}
  302. */
  303. function (component) {
  304. return /** @type {?} */ (this._delegate.getComponentFactory(component));
  305. };
  306. /**
  307. * @return {?}
  308. */
  309. CompilerImpl.prototype.clearCache = /**
  310. * @return {?}
  311. */
  312. function () { this._delegate.clearCache(); };
  313. /**
  314. * @param {?} type
  315. * @return {?}
  316. */
  317. CompilerImpl.prototype.clearCacheFor = /**
  318. * @param {?} type
  319. * @return {?}
  320. */
  321. function (type) { this._delegate.clearCacheFor(type); };
  322. return CompilerImpl;
  323. }());
  324. /**
  325. * A set of providers that provide `JitCompiler` and its dependencies to use for
  326. * template compilation.
  327. */
  328. var COMPILER_PROVIDERS = /** @type {?} */ ([
  329. { provide: CompileReflector, useValue: new JitReflector() },
  330. { provide: ResourceLoader, useValue: _NO_RESOURCE_LOADER },
  331. { provide: JitSummaryResolver, deps: [] },
  332. { provide: SummaryResolver, useExisting: JitSummaryResolver },
  333. { provide: ɵConsole, deps: [] },
  334. { provide: Lexer, deps: [] },
  335. { provide: Parser, deps: [Lexer] },
  336. {
  337. provide: baseHtmlParser,
  338. useClass: HtmlParser,
  339. deps: [],
  340. },
  341. {
  342. provide: I18NHtmlParser,
  343. useFactory: function (parser, translations, format, config, console) {
  344. translations = translations || '';
  345. var /** @type {?} */ missingTranslation = translations ? /** @type {?} */ ((config.missingTranslation)) : MissingTranslationStrategy.Ignore;
  346. return new I18NHtmlParser(parser, translations, format, missingTranslation, console);
  347. },
  348. deps: [
  349. baseHtmlParser,
  350. [new Optional(), new Inject(TRANSLATIONS)],
  351. [new Optional(), new Inject(TRANSLATIONS_FORMAT)],
  352. [CompilerConfig],
  353. [ɵConsole],
  354. ]
  355. },
  356. {
  357. provide: HtmlParser,
  358. useExisting: I18NHtmlParser,
  359. },
  360. {
  361. provide: TemplateParser, deps: [CompilerConfig, CompileReflector,
  362. Parser, ElementSchemaRegistry,
  363. I18NHtmlParser, ɵConsole]
  364. },
  365. { provide: DirectiveNormalizer, deps: [ResourceLoader, UrlResolver, HtmlParser, CompilerConfig] },
  366. { provide: CompileMetadataResolver, deps: [CompilerConfig, HtmlParser, NgModuleResolver,
  367. DirectiveResolver, PipeResolver,
  368. SummaryResolver,
  369. ElementSchemaRegistry,
  370. DirectiveNormalizer, ɵConsole,
  371. [Optional, StaticSymbolCache],
  372. CompileReflector,
  373. [Optional, ERROR_COLLECTOR_TOKEN]] },
  374. DEFAULT_PACKAGE_URL_PROVIDER,
  375. { provide: StyleCompiler, deps: [UrlResolver] },
  376. { provide: ViewCompiler, deps: [CompileReflector] },
  377. { provide: NgModuleCompiler, deps: [CompileReflector] },
  378. { provide: CompilerConfig, useValue: new CompilerConfig() },
  379. { provide: Compiler, useClass: CompilerImpl, deps: [Injector, CompileMetadataResolver,
  380. TemplateParser, StyleCompiler,
  381. ViewCompiler, NgModuleCompiler,
  382. SummaryResolver, CompileReflector, CompilerConfig,
  383. ɵConsole] },
  384. { provide: DomElementSchemaRegistry, deps: [] },
  385. { provide: ElementSchemaRegistry, useExisting: DomElementSchemaRegistry },
  386. { provide: UrlResolver, deps: [PACKAGE_ROOT_URL] },
  387. { provide: DirectiveResolver, deps: [CompileReflector] },
  388. { provide: PipeResolver, deps: [CompileReflector] },
  389. { provide: NgModuleResolver, deps: [CompileReflector] },
  390. ]);
  391. /**
  392. * \@experimental
  393. */
  394. var JitCompilerFactory = /** @class */ (function () {
  395. /* @internal */
  396. function JitCompilerFactory(defaultOptions) {
  397. var /** @type {?} */ compilerOptions = {
  398. useJit: true,
  399. defaultEncapsulation: ViewEncapsulation.Emulated,
  400. missingTranslation: MissingTranslationStrategy.Warning,
  401. enableLegacyTemplate: false,
  402. };
  403. this._defaultOptions = [compilerOptions].concat(defaultOptions);
  404. }
  405. /**
  406. * @param {?=} options
  407. * @return {?}
  408. */
  409. JitCompilerFactory.prototype.createCompiler = /**
  410. * @param {?=} options
  411. * @return {?}
  412. */
  413. function (options) {
  414. if (options === void 0) { options = []; }
  415. var /** @type {?} */ opts = _mergeOptions(this._defaultOptions.concat(options));
  416. var /** @type {?} */ injector = Injector.create([
  417. COMPILER_PROVIDERS, {
  418. provide: CompilerConfig,
  419. useFactory: function () {
  420. return new CompilerConfig({
  421. // let explicit values from the compiler options overwrite options
  422. // from the app providers
  423. useJit: opts.useJit,
  424. jitDevMode: isDevMode(),
  425. // let explicit values from the compiler options overwrite options
  426. // from the app providers
  427. defaultEncapsulation: opts.defaultEncapsulation,
  428. missingTranslation: opts.missingTranslation,
  429. enableLegacyTemplate: opts.enableLegacyTemplate,
  430. preserveWhitespaces: opts.preserveWhitespaces,
  431. });
  432. },
  433. deps: []
  434. },
  435. /** @type {?} */ ((opts.providers))
  436. ]);
  437. return injector.get(Compiler);
  438. };
  439. return JitCompilerFactory;
  440. }());
  441. /**
  442. * @param {?} optionsArr
  443. * @return {?}
  444. */
  445. function _mergeOptions(optionsArr) {
  446. return {
  447. useJit: _lastDefined(optionsArr.map(function (options) { return options.useJit; })),
  448. defaultEncapsulation: _lastDefined(optionsArr.map(function (options) { return options.defaultEncapsulation; })),
  449. providers: _mergeArrays(optionsArr.map(function (options) { return ((options.providers)); })),
  450. missingTranslation: _lastDefined(optionsArr.map(function (options) { return options.missingTranslation; })),
  451. enableLegacyTemplate: _lastDefined(optionsArr.map(function (options) { return options.enableLegacyTemplate; })),
  452. preserveWhitespaces: _lastDefined(optionsArr.map(function (options) { return options.preserveWhitespaces; })),
  453. };
  454. }
  455. /**
  456. * @template T
  457. * @param {?} args
  458. * @return {?}
  459. */
  460. function _lastDefined(args) {
  461. for (var /** @type {?} */ i = args.length - 1; i >= 0; i--) {
  462. if (args[i] !== undefined) {
  463. return args[i];
  464. }
  465. }
  466. return undefined;
  467. }
  468. /**
  469. * @param {?} parts
  470. * @return {?}
  471. */
  472. function _mergeArrays(parts) {
  473. var /** @type {?} */ result = [];
  474. parts.forEach(function (part) { return part && result.push.apply(result, part); });
  475. return result;
  476. }
  477. /**
  478. * @fileoverview added by tsickle
  479. * @suppress {checkTypes} checked by tsc
  480. */
  481. /**
  482. * @license
  483. * Copyright Google Inc. All Rights Reserved.
  484. *
  485. * Use of this source code is governed by an MIT-style license that can be
  486. * found in the LICENSE file at https://angular.io/license
  487. */
  488. /**
  489. * A platform that included corePlatform and the compiler.
  490. *
  491. * \@experimental
  492. */
  493. var platformCoreDynamic = createPlatformFactory(platformCore, 'coreDynamic', [
  494. { provide: COMPILER_OPTIONS, useValue: {}, multi: true },
  495. { provide: CompilerFactory, useClass: JitCompilerFactory, deps: [COMPILER_OPTIONS] },
  496. ]);
  497. /**
  498. * @fileoverview added by tsickle
  499. * @suppress {checkTypes} checked by tsc
  500. */
  501. var ResourceLoaderImpl = /** @class */ (function (_super) {
  502. __extends(ResourceLoaderImpl, _super);
  503. function ResourceLoaderImpl() {
  504. return _super !== null && _super.apply(this, arguments) || this;
  505. }
  506. /**
  507. * @param {?} url
  508. * @return {?}
  509. */
  510. ResourceLoaderImpl.prototype.get = /**
  511. * @param {?} url
  512. * @return {?}
  513. */
  514. function (url) {
  515. var /** @type {?} */ resolve;
  516. var /** @type {?} */ reject;
  517. var /** @type {?} */ promise = new Promise(function (res, rej) {
  518. resolve = res;
  519. reject = rej;
  520. });
  521. var /** @type {?} */ xhr = new XMLHttpRequest();
  522. xhr.open('GET', url, true);
  523. xhr.responseType = 'text';
  524. xhr.onload = function () {
  525. // responseText is the old-school way of retrieving response (supported by IE8 & 9)
  526. // response/responseType properties were introduced in ResourceLoader Level2 spec (supported
  527. // by IE10)
  528. var /** @type {?} */ response = xhr.response || xhr.responseText;
  529. // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
  530. var /** @type {?} */ status = xhr.status === 1223 ? 204 : xhr.status;
  531. // fix status code when it is 0 (0 status is undocumented).
  532. // Occurs when accessing file resources or on Android 4.1 stock browser
  533. // while retrieving files from application cache.
  534. if (status === 0) {
  535. status = response ? 200 : 0;
  536. }
  537. if (200 <= status && status <= 300) {
  538. resolve(response);
  539. }
  540. else {
  541. reject("Failed to load " + url);
  542. }
  543. };
  544. xhr.onerror = function () { reject("Failed to load " + url); };
  545. xhr.send();
  546. return promise;
  547. };
  548. ResourceLoaderImpl.decorators = [
  549. { type: Injectable },
  550. ];
  551. /** @nocollapse */
  552. ResourceLoaderImpl.ctorParameters = function () { return []; };
  553. return ResourceLoaderImpl;
  554. }(ResourceLoader));
  555. /**
  556. * @fileoverview added by tsickle
  557. * @suppress {checkTypes} checked by tsc
  558. */
  559. /**
  560. * @license
  561. * Copyright Google Inc. All Rights Reserved.
  562. *
  563. * Use of this source code is governed by an MIT-style license that can be
  564. * found in the LICENSE file at https://angular.io/license
  565. */
  566. var INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS = [
  567. ɵINTERNAL_BROWSER_PLATFORM_PROVIDERS,
  568. {
  569. provide: COMPILER_OPTIONS,
  570. useValue: { providers: [{ provide: ResourceLoader, useClass: ResourceLoaderImpl, deps: [] }] },
  571. multi: true
  572. },
  573. { provide: PLATFORM_ID, useValue: ɵPLATFORM_BROWSER_ID },
  574. ];
  575. /**
  576. * @fileoverview added by tsickle
  577. * @suppress {checkTypes} checked by tsc
  578. */
  579. /**
  580. * @license
  581. * Copyright Google Inc. All Rights Reserved.
  582. *
  583. * Use of this source code is governed by an MIT-style license that can be
  584. * found in the LICENSE file at https://angular.io/license
  585. */
  586. /**
  587. * An implementation of ResourceLoader that uses a template cache to avoid doing an actual
  588. * ResourceLoader.
  589. *
  590. * The template cache needs to be built and loaded into window.$templateCache
  591. * via a separate mechanism.
  592. */
  593. var CachedResourceLoader = /** @class */ (function (_super) {
  594. __extends(CachedResourceLoader, _super);
  595. function CachedResourceLoader() {
  596. var _this = _super.call(this) || this;
  597. _this._cache = (/** @type {?} */ (ɵglobal)).$templateCache;
  598. if (_this._cache == null) {
  599. throw new Error('CachedResourceLoader: Template cache was not found in $templateCache.');
  600. }
  601. return _this;
  602. }
  603. /**
  604. * @param {?} url
  605. * @return {?}
  606. */
  607. CachedResourceLoader.prototype.get = /**
  608. * @param {?} url
  609. * @return {?}
  610. */
  611. function (url) {
  612. if (this._cache.hasOwnProperty(url)) {
  613. return Promise.resolve(this._cache[url]);
  614. }
  615. else {
  616. return /** @type {?} */ (Promise.reject('CachedResourceLoader: Did not find cached template for ' + url));
  617. }
  618. };
  619. return CachedResourceLoader;
  620. }(ResourceLoader));
  621. /**
  622. * @fileoverview added by tsickle
  623. * @suppress {checkTypes} checked by tsc
  624. */
  625. /**
  626. * @license
  627. * Copyright Google Inc. All Rights Reserved.
  628. *
  629. * Use of this source code is governed by an MIT-style license that can be
  630. * found in the LICENSE file at https://angular.io/license
  631. */
  632. /**
  633. * @fileoverview added by tsickle
  634. * @suppress {checkTypes} checked by tsc
  635. */
  636. /**
  637. * @license
  638. * Copyright Google Inc. All Rights Reserved.
  639. *
  640. * Use of this source code is governed by an MIT-style license that can be
  641. * found in the LICENSE file at https://angular.io/license
  642. */
  643. /**
  644. * \@stable
  645. */
  646. var VERSION = new Version('5.2.11');
  647. /**
  648. * @fileoverview added by tsickle
  649. * @suppress {checkTypes} checked by tsc
  650. */
  651. /**
  652. * @license
  653. * Copyright Google Inc. All Rights Reserved.
  654. *
  655. * Use of this source code is governed by an MIT-style license that can be
  656. * found in the LICENSE file at https://angular.io/license
  657. */
  658. /**
  659. * \@experimental
  660. */
  661. var RESOURCE_CACHE_PROVIDER = [{ provide: ResourceLoader, useClass: CachedResourceLoader, deps: [] }];
  662. /**
  663. * \@stable
  664. */
  665. var platformBrowserDynamic = createPlatformFactory(platformCoreDynamic, 'browserDynamic', INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS);
  666. /**
  667. * @fileoverview added by tsickle
  668. * @suppress {checkTypes} checked by tsc
  669. */
  670. /**
  671. * @license
  672. * Copyright Google Inc. All Rights Reserved.
  673. *
  674. * Use of this source code is governed by an MIT-style license that can be
  675. * found in the LICENSE file at https://angular.io/license
  676. */
  677. /**
  678. * @module
  679. * @description
  680. * Entry point for all public APIs of this package.
  681. */
  682. // This file only reexports content of the `src` folder. Keep it that way.
  683. /**
  684. * @fileoverview added by tsickle
  685. * @suppress {checkTypes} checked by tsc
  686. */
  687. /**
  688. * Generated bundle index. Do not edit.
  689. */
  690. export { VERSION, JitCompilerFactory, RESOURCE_CACHE_PROVIDER, platformBrowserDynamic, CompilerImpl as ɵCompilerImpl, platformCoreDynamic as ɵplatformCoreDynamic, INTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS as ɵINTERNAL_BROWSER_DYNAMIC_PLATFORM_PROVIDERS, ResourceLoaderImpl as ɵResourceLoaderImpl, CachedResourceLoader as ɵa };
  691. //# sourceMappingURL=platform-browser-dynamic.js.map