1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 | var development_env_1 = tslib_1.__importDefault(require("./commons/environment/development.env"));
|
5 | var production_env_1 = tslib_1.__importDefault(require("./commons/environment/production.env"));
|
6 | var default_config_1 = tslib_1.__importDefault(require("./loader/default.config"));
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | var RecSys = (function () {
|
15 | function RecSys() {
|
16 | }
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 | RecSys.init = function (config) {
|
26 | window._RecSys = window._RecSys || {};
|
27 | window._RecSys.Bundle = window._RecSys.Bundle;
|
28 | var properties = this.env(config) === "production" ? production_env_1.default : development_env_1.default;
|
29 | window._RecSys.Bundle = {
|
30 | Properties: properties(config.store.slug),
|
31 | Configuration: this.mergeConfig(config),
|
32 | Version: "__version__",
|
33 | Environment: this.env(config),
|
34 | };
|
35 | };
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | RecSys.mergeConfig = function (config) {
|
46 | return Object.assign(default_config_1.default, config);
|
47 | };
|
48 | |
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 | RecSys.env = function (config) {
|
59 | return config.environment || "__environment__";
|
60 | };
|
61 | return RecSys;
|
62 | }());
|
63 | exports.default = RecSys;
|
64 |
|
\ | No newline at end of file |