@banta/sdk 1.0.2 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/banta-sdk.metadata.json +1 -1
  2. package/bundles/banta-sdk.umd.js +1374 -1341
  3. package/bundles/banta-sdk.umd.js.map +1 -1
  4. package/bundles/banta-sdk.umd.min.js +1 -15
  5. package/bundles/banta-sdk.umd.min.js.map +1 -1
  6. package/esm2015/banta-sdk.js +1 -1
  7. package/esm2015/lib/banta/banta.component.js +20 -46
  8. package/esm2015/lib/banta-logo.component.js +10 -12
  9. package/esm2015/lib/banta-sdk.module.js +45 -36
  10. package/esm2015/lib/chat/banta-chat/banta-chat.component.js +47 -86
  11. package/esm2015/lib/chat/chat-message/chat-message.component.js +16 -35
  12. package/esm2015/lib/chat/chat-view/chat-view.component.js +19 -46
  13. package/esm2015/lib/chat/chat.module.js +16 -18
  14. package/esm2015/lib/chat/index.js +1 -1
  15. package/esm2015/lib/chat/live-chat-message.component.js +20 -37
  16. package/esm2015/lib/comments/banta-comments/banta-comments.component.js +86 -81
  17. package/esm2015/lib/comments/comment/comment.component.js +17 -39
  18. package/esm2015/lib/comments/comment-view/comment-view.component.js +96 -69
  19. package/esm2015/lib/comments/comments.module.js +26 -20
  20. package/esm2015/lib/comments/index.js +1 -1
  21. package/esm2015/lib/comments/live-comment.component.js +20 -37
  22. package/esm2015/lib/common/banta.service.js +6 -8
  23. package/esm2015/lib/common/chat-backend.service.js +7 -0
  24. package/esm2015/lib/common/common.module.js +12 -24
  25. package/esm2015/lib/common/index.js +2 -1
  26. package/esm2015/lib/common/lazy-connection.js +1 -1
  27. package/esm2015/lib/common/timestamp.component.js +13 -17
  28. package/esm2015/lib/emoji/emoji-selector-button.component.js +13 -17
  29. package/esm2015/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.js +14 -18
  30. package/esm2015/lib/emoji/emoji.module.js +14 -16
  31. package/esm2015/lib/emoji/emojis.js +1 -1
  32. package/esm2015/lib/emoji/index.js +1 -1
  33. package/esm2015/lib/index.js +1 -2
  34. package/esm2015/lib/live-message.component.js +17 -33
  35. package/esm2015/public-api.js +1 -1
  36. package/fesm2015/banta-sdk.js +503 -638
  37. package/fesm2015/banta-sdk.js.map +1 -1
  38. package/lib/banta/banta.component.d.ts +1 -2
  39. package/lib/banta-sdk.module.d.ts +2 -0
  40. package/lib/chat/banta-chat/banta-chat.component.d.ts +2 -3
  41. package/lib/chat/live-chat-message.component.d.ts +1 -1
  42. package/lib/comments/banta-comments/banta-comments.component.d.ts +14 -3
  43. package/lib/comments/comment-view/comment-view.component.d.ts +15 -2
  44. package/lib/comments/live-comment.component.d.ts +1 -1
  45. package/lib/{chat-backend.service.d.ts → common/chat-backend.service.d.ts} +0 -0
  46. package/lib/common/common.module.d.ts +0 -2
  47. package/lib/common/index.d.ts +1 -0
  48. package/lib/emoji/emojis.d.ts +2 -2
  49. package/lib/index.d.ts +0 -1
  50. package/package.json +14 -16
  51. package/esm2015/lib/chat-backend.service.js +0 -9
  52. package/esm5/banta-sdk.js +0 -5
  53. package/esm5/lib/banta/banta.component.js +0 -293
  54. package/esm5/lib/banta-logo.component.js +0 -16
  55. package/esm5/lib/banta-sdk.module.js +0 -56
  56. package/esm5/lib/chat/banta-chat/banta-chat.component.js +0 -245
  57. package/esm5/lib/chat/chat-message/chat-message.component.js +0 -92
  58. package/esm5/lib/chat/chat-view/chat-view.component.js +0 -198
  59. package/esm5/lib/chat/chat.module.js +0 -37
  60. package/esm5/lib/chat/index.js +0 -6
  61. package/esm5/lib/chat/live-chat-message.component.js +0 -98
  62. package/esm5/lib/chat-backend.service.js +0 -12
  63. package/esm5/lib/comments/banta-comments/banta-comments.component.js +0 -228
  64. package/esm5/lib/comments/comment/comment.component.js +0 -97
  65. package/esm5/lib/comments/comment-view/comment-view.component.js +0 -191
  66. package/esm5/lib/comments/comments.module.js +0 -41
  67. package/esm5/lib/comments/index.js +0 -6
  68. package/esm5/lib/comments/live-comment.component.js +0 -98
  69. package/esm5/lib/common/banta.service.js +0 -32
  70. package/esm5/lib/common/common.module.js +0 -34
  71. package/esm5/lib/common/index.js +0 -5
  72. package/esm5/lib/common/lazy-connection.js +0 -15
  73. package/esm5/lib/common/timestamp.component.js +0 -109
  74. package/esm5/lib/emoji/emoji-selector-button.component.js +0 -64
  75. package/esm5/lib/emoji/emoji-selector-panel/emoji-selector-panel.component.js +0 -74
  76. package/esm5/lib/emoji/emoji.module.js +0 -29
  77. package/esm5/lib/emoji/emojis.js +0 -6508
  78. package/esm5/lib/emoji/index.js +0 -5
  79. package/esm5/lib/index.js +0 -10
  80. package/esm5/lib/live-message.component.js +0 -89
  81. package/esm5/public-api.js +0 -5
  82. package/fesm5/banta-sdk.js +0 -8541
  83. package/fesm5/banta-sdk.js.map +0 -1
@@ -1,222 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/material/icon'), require('@angular/material/button'), require('subsink'), require('@angular/material/dialog'), require('@angular/forms'), require('@angular/material/menu'), require('@angular/material/tooltip'), require('@angular/material/form-field'), require('@angular/material/input')) :
3
- typeof define === 'function' && define.amd ? define('@banta/sdk', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/common', '@angular/platform-browser', '@angular/material/icon', '@angular/material/button', 'subsink', '@angular/material/dialog', '@angular/forms', '@angular/material/menu', '@angular/material/tooltip', '@angular/material/form-field', '@angular/material/input'], factory) :
4
- (global = global || self, factory((global.banta = global.banta || {}, global.banta.sdk = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.common, global.ng.platformBrowser, global.ng.material.icon, global.ng.material.button, global.subsink, global.ng.material.dialog, global.ng.forms, global.ng.material.menu, global.ng.material.tooltip, global.ng.material.formField, global.ng.material.input));
5
- }(this, (function (exports, rxjs, operators, core, common, platformBrowser, icon, button, subsink, dialog, forms, menu, tooltip, formField, input) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation. All rights reserved.
9
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
- this file except in compliance with the License. You may obtain a copy of the
11
- License at http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
- MERCHANTABLITY OR NON-INFRINGEMENT.
17
-
18
- See the Apache Version 2.0 License for specific language governing permissions
19
- and limitations under the License.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- function __exportStar(m, exports) {
113
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
114
- }
115
-
116
- function __values(o) {
117
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
118
- if (m) return m.call(o);
119
- if (o && typeof o.length === "number") return {
120
- next: function () {
121
- if (o && i >= o.length) o = void 0;
122
- return { value: o && o[i++], done: !o };
123
- }
124
- };
125
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
126
- }
127
-
128
- function __read(o, n) {
129
- var m = typeof Symbol === "function" && o[Symbol.iterator];
130
- if (!m) return o;
131
- var i = m.call(o), r, ar = [], e;
132
- try {
133
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
134
- }
135
- catch (error) { e = { error: error }; }
136
- finally {
137
- try {
138
- if (r && !r.done && (m = i["return"])) m.call(i);
139
- }
140
- finally { if (e) throw e.error; }
141
- }
142
- return ar;
143
- }
144
-
145
- function __spread() {
146
- for (var ar = [], i = 0; i < arguments.length; i++)
147
- ar = ar.concat(__read(arguments[i]));
148
- return ar;
149
- }
150
-
151
- function __spreadArrays() {
152
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
153
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
154
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
155
- r[k] = a[j];
156
- return r;
157
- };
158
-
159
- function __await(v) {
160
- return this instanceof __await ? (this.v = v, this) : new __await(v);
161
- }
162
-
163
- function __asyncGenerator(thisArg, _arguments, generator) {
164
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
165
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
166
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
167
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
168
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
169
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
170
- function fulfill(value) { resume("next", value); }
171
- function reject(value) { resume("throw", value); }
172
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
173
- }
174
-
175
- function __asyncDelegator(o) {
176
- var i, p;
177
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
178
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
179
- }
180
-
181
- function __asyncValues(o) {
182
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
183
- var m = o[Symbol.asyncIterator], i;
184
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
185
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
186
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
187
- }
188
-
189
- function __makeTemplateObject(cooked, raw) {
190
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
191
- return cooked;
192
- };
193
-
194
- function __importStar(mod) {
195
- if (mod && mod.__esModule) return mod;
196
- var result = {};
197
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
198
- result.default = mod;
199
- return result;
200
- }
201
-
202
- function __importDefault(mod) {
203
- return (mod && mod.__esModule) ? mod : { default: mod };
204
- }
205
-
206
- function __classPrivateFieldGet(receiver, privateMap) {
207
- if (!privateMap.has(receiver)) {
208
- throw new TypeError("attempted to get private field on non-instance");
209
- }
210
- return privateMap.get(receiver);
211
- }
212
-
213
- function __classPrivateFieldSet(receiver, privateMap, value) {
214
- if (!privateMap.has(receiver)) {
215
- throw new TypeError("attempted to set private field on non-instance");
216
- }
217
- privateMap.set(receiver, value);
218
- return value;
219
- }
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs'), require('rxjs/operators'), require('@angular/core'), require('@angular/common'), require('@angular/platform-browser'), require('@angular/material/icon'), require('@angular/material/button'), require('subsink'), require('@angular/material/dialog'), require('@angular/forms'), require('@angular/material/menu'), require('@angular/material/progress-spinner'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/cdk/text-field'), require('@angular/material/tooltip')) :
3
+ typeof define === 'function' && define.amd ? define('@banta/sdk', ['exports', 'rxjs', 'rxjs/operators', '@angular/core', '@angular/common', '@angular/platform-browser', '@angular/material/icon', '@angular/material/button', 'subsink', '@angular/material/dialog', '@angular/forms', '@angular/material/menu', '@angular/material/progress-spinner', '@angular/material/form-field', '@angular/material/input', '@angular/cdk/text-field', '@angular/material/tooltip'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.banta = global.banta || {}, global.banta.sdk = {}), global.rxjs, global.rxjs.operators, global.ng.core, global.ng.common, global.ng.platformBrowser, global.ng.material.icon, global.ng.material.button, global.subsink, global.ng.material.dialog, global.ng.forms, global.ng.material.menu, global.ng.material.progressSpinner, global.ng.material.formField, global.ng.material.input, global.ng.cdk.textField, global.ng.material.tooltip));
5
+ }(this, (function (exports, rxjs, operators, core, common, platformBrowser, icon, button, subsink, dialog, forms, menu, progressSpinner, formField, input, textField, tooltip) { 'use strict';
220
6
 
221
7
  function lazyConnection(options) {
222
8
  var obs = new rxjs.Observable(function (observer) {
@@ -239,7 +25,7 @@
239
25
  get: function () {
240
26
  return this._userChanged;
241
27
  },
242
- enumerable: true,
28
+ enumerable: false,
243
29
  configurable: true
244
30
  });
245
31
  Object.defineProperty(BantaService.prototype, "user", {
@@ -250,14 +36,14 @@
250
36
  this._user = user;
251
37
  this._userChanged.next(user);
252
38
  },
253
- enumerable: true,
39
+ enumerable: false,
254
40
  configurable: true
255
41
  });
256
- BantaService = __decorate([
257
- core.Injectable()
258
- ], BantaService);
259
42
  return BantaService;
260
- }());
43
+ }());
44
+ BantaService.decorators = [
45
+ { type: core.Injectable }
46
+ ];
261
47
 
262
48
  var TimestampComponent = /** @class */ (function () {
263
49
  function TimestampComponent() {
@@ -278,7 +64,7 @@
278
64
  this._value = v;
279
65
  this.update();
280
66
  },
281
- enumerable: true,
67
+ enumerable: false,
282
68
  configurable: true
283
69
  });
284
70
  TimestampComponent.prototype.update = function () {
@@ -350,20 +136,27 @@
350
136
  }
351
137
  }
352
138
  };
353
- __decorate([
354
- core.Input(),
355
- __metadata("design:type", Object),
356
- __metadata("design:paramtypes", [Object])
357
- ], TimestampComponent.prototype, "value", null);
358
- TimestampComponent = __decorate([
359
- core.Component({
360
- selector: 'banta-timestamp',
361
- template: "\n <span *ngIf=\"showAbsolute\" [title]=\"value | date : 'short'\">\n {{value | date : 'shortDate'}}\n </span>\n <span *ngIf=\"!showAbsolute\" [title]=\"value | date : 'short'\">\n {{relative}}\n </span>\n ",
362
- styles: [""]
363
- })
364
- ], TimestampComponent);
365
139
  return TimestampComponent;
366
- }());
140
+ }());
141
+ TimestampComponent.decorators = [
142
+ { type: core.Component, args: [{
143
+ selector: 'banta-timestamp',
144
+ template: "\n <span *ngIf=\"showAbsolute\" [title]=\"value | date : 'short'\">\n {{value | date : 'shortDate'}}\n </span>\n <span *ngIf=\"!showAbsolute\" [title]=\"value | date : 'short'\">\n {{relative}}\n </span>\n ",
145
+ styles: [""]
146
+ },] }
147
+ ];
148
+ TimestampComponent.propDecorators = {
149
+ value: [{ type: core.Input }]
150
+ };
151
+
152
+ var ChatBackendService = /** @class */ (function () {
153
+ function ChatBackendService() {
154
+ }
155
+ return ChatBackendService;
156
+ }());
157
+ ChatBackendService.decorators = [
158
+ { type: core.Injectable }
159
+ ];
367
160
 
368
161
  var COMPONENTS = [
369
162
  TimestampComponent
@@ -371,132 +164,440 @@
371
164
  var BantaCommonModule = /** @class */ (function () {
372
165
  function BantaCommonModule() {
373
166
  }
374
- BantaCommonModule_1 = BantaCommonModule;
375
- BantaCommonModule.forRoot = function () {
376
- return {
377
- ngModule: BantaCommonModule_1,
378
- providers: [
379
- BantaService
380
- ]
381
- };
382
- };
383
- var BantaCommonModule_1;
384
- BantaCommonModule = BantaCommonModule_1 = __decorate([
385
- core.NgModule({
386
- declarations: COMPONENTS,
387
- imports: [
388
- common.CommonModule
389
- ],
390
- exports: COMPONENTS
391
- })
392
- ], BantaCommonModule);
393
167
  return BantaCommonModule;
394
- }());
168
+ }());
169
+ BantaCommonModule.decorators = [
170
+ { type: core.NgModule, args: [{
171
+ declarations: COMPONENTS,
172
+ imports: [
173
+ common.CommonModule
174
+ ],
175
+ exports: COMPONENTS
176
+ },] }
177
+ ];
395
178
 
396
- var EMOJIS = {
397
- "grinning": {
398
- "keywords": ["face", "smile", "happy", "joy", ":D", "grin"],
399
- "char": "😀",
400
- "category": "people"
401
- },
402
- "grimacing": {
403
- "keywords": ["face", "grimace", "teeth"],
404
- "char": "😬",
405
- "category": "people"
406
- },
407
- "grin": {
408
- "keywords": ["face", "happy", "smile", "joy", "kawaii"],
409
- "char": "😁",
410
- "category": "people"
411
- },
412
- "joy": {
413
- "keywords": ["face", "cry", "tears", "weep", "happy", "happytears", "haha"],
414
- "char": "😂",
415
- "category": "people"
416
- },
417
- "smiley": {
418
- "keywords": ["face", "happy", "joy", "haha", ":D", ":)", "smile", "funny"],
419
- "char": "😃",
420
- "category": "people"
421
- },
422
- "smile": {
423
- "keywords": ["face", "happy", "joy", "funny", "haha", "laugh", "like", ":D", ":)"],
424
- "char": "😄",
425
- "category": "people"
426
- },
427
- "sweat_smile": {
428
- "keywords": ["face", "hot", "happy", "laugh", "sweat", "smile", "relief"],
429
- "char": "😅",
430
- "category": "people"
431
- },
432
- "laughing": {
433
- "keywords": ["happy", "joy", "lol", "satisfied", "haha", "face", "glad", "XD", "laugh"],
434
- "char": "😆",
435
- "category": "people"
436
- },
437
- "innocent": {
438
- "keywords": ["face", "angel", "heaven", "halo"],
439
- "char": "😇",
440
- "category": "people"
441
- },
442
- "wink": {
443
- "keywords": ["face", "happy", "mischievous", "secret", ";)", "smile"],
444
- "char": "😉",
445
- "category": "people"
446
- },
447
- "blush": {
448
- "keywords": ["face", "smile", "happy", "flushed", "crush", "embarrassed", "shy", "joy"],
449
- "char": "😊",
450
- "category": "people"
451
- },
452
- "slightly_smiling": {
453
- "keywords": ["face", "smile"],
454
- "char": "🙂",
455
- "category": "people"
456
- },
457
- "upside_down": {
458
- "keywords": ["face", "flipped", "silly", "smile"],
459
- "char": "🙃",
460
- "category": "people"
461
- },
462
- "relaxed": {
463
- "keywords": ["face", "blush", "massage", "happiness"],
464
- "char": "☺️",
465
- "category": "people"
466
- },
467
- "yum": {
468
- "keywords": ["happy", "joy", "tongue", "smile", "face", "silly", "yummy", "nom"],
469
- "char": "😋",
470
- "category": "people"
471
- },
472
- "relieved": {
473
- "keywords": ["face", "relaxed", "phew", "massage", "happiness"],
474
- "char": "😌",
475
- "category": "people"
476
- },
477
- "heart_eyes": {
478
- "keywords": ["face", "love", "like", "affection", "valentines", "infatuation", "crush", "heart"],
479
- "char": "😍",
480
- "category": "people"
481
- },
482
- "kissing_heart": {
483
- "keywords": ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"],
484
- "char": "😘",
485
- "category": "people"
486
- },
487
- "kissing": {
488
- "keywords": ["love", "like", "face", "3", "valentines", "infatuation", "kiss"],
489
- "char": "😗",
490
- "category": "people"
491
- },
492
- "kissing_smiling_eyes": {
493
- "keywords": ["face", "affection", "valentines", "infatuation", "kiss"],
494
- "char": "😙",
495
- "category": "people"
496
- },
497
- "kissing_closed_eyes": {
498
- "keywords": ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"],
499
- "char": "😚",
179
+ /*! *****************************************************************************
180
+ Copyright (c) Microsoft Corporation.
181
+
182
+ Permission to use, copy, modify, and/or distribute this software for any
183
+ purpose with or without fee is hereby granted.
184
+
185
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
186
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
187
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
188
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
189
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
190
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
191
+ PERFORMANCE OF THIS SOFTWARE.
192
+ ***************************************************************************** */
193
+ /* global Reflect, Promise */
194
+ var extendStatics = function (d, b) {
195
+ extendStatics = Object.setPrototypeOf ||
196
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
197
+ function (d, b) { for (var p in b)
198
+ if (Object.prototype.hasOwnProperty.call(b, p))
199
+ d[p] = b[p]; };
200
+ return extendStatics(d, b);
201
+ };
202
+ function __extends(d, b) {
203
+ if (typeof b !== "function" && b !== null)
204
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
205
+ extendStatics(d, b);
206
+ function __() { this.constructor = d; }
207
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
208
+ }
209
+ var __assign = function () {
210
+ __assign = Object.assign || function __assign(t) {
211
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
212
+ s = arguments[i];
213
+ for (var p in s)
214
+ if (Object.prototype.hasOwnProperty.call(s, p))
215
+ t[p] = s[p];
216
+ }
217
+ return t;
218
+ };
219
+ return __assign.apply(this, arguments);
220
+ };
221
+ function __rest(s, e) {
222
+ var t = {};
223
+ for (var p in s)
224
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
225
+ t[p] = s[p];
226
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
227
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
228
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
229
+ t[p[i]] = s[p[i]];
230
+ }
231
+ return t;
232
+ }
233
+ function __decorate(decorators, target, key, desc) {
234
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
235
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
236
+ r = Reflect.decorate(decorators, target, key, desc);
237
+ else
238
+ for (var i = decorators.length - 1; i >= 0; i--)
239
+ if (d = decorators[i])
240
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
241
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
242
+ }
243
+ function __param(paramIndex, decorator) {
244
+ return function (target, key) { decorator(target, key, paramIndex); };
245
+ }
246
+ function __metadata(metadataKey, metadataValue) {
247
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
248
+ return Reflect.metadata(metadataKey, metadataValue);
249
+ }
250
+ function __awaiter(thisArg, _arguments, P, generator) {
251
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
252
+ return new (P || (P = Promise))(function (resolve, reject) {
253
+ function fulfilled(value) { try {
254
+ step(generator.next(value));
255
+ }
256
+ catch (e) {
257
+ reject(e);
258
+ } }
259
+ function rejected(value) { try {
260
+ step(generator["throw"](value));
261
+ }
262
+ catch (e) {
263
+ reject(e);
264
+ } }
265
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
266
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
267
+ });
268
+ }
269
+ function __generator(thisArg, body) {
270
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
271
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
272
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
273
+ function verb(n) { return function (v) { return step([n, v]); }; }
274
+ function step(op) {
275
+ if (f)
276
+ throw new TypeError("Generator is already executing.");
277
+ while (_)
278
+ try {
279
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
280
+ return t;
281
+ if (y = 0, t)
282
+ op = [op[0] & 2, t.value];
283
+ switch (op[0]) {
284
+ case 0:
285
+ case 1:
286
+ t = op;
287
+ break;
288
+ case 4:
289
+ _.label++;
290
+ return { value: op[1], done: false };
291
+ case 5:
292
+ _.label++;
293
+ y = op[1];
294
+ op = [0];
295
+ continue;
296
+ case 7:
297
+ op = _.ops.pop();
298
+ _.trys.pop();
299
+ continue;
300
+ default:
301
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
302
+ _ = 0;
303
+ continue;
304
+ }
305
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
306
+ _.label = op[1];
307
+ break;
308
+ }
309
+ if (op[0] === 6 && _.label < t[1]) {
310
+ _.label = t[1];
311
+ t = op;
312
+ break;
313
+ }
314
+ if (t && _.label < t[2]) {
315
+ _.label = t[2];
316
+ _.ops.push(op);
317
+ break;
318
+ }
319
+ if (t[2])
320
+ _.ops.pop();
321
+ _.trys.pop();
322
+ continue;
323
+ }
324
+ op = body.call(thisArg, _);
325
+ }
326
+ catch (e) {
327
+ op = [6, e];
328
+ y = 0;
329
+ }
330
+ finally {
331
+ f = t = 0;
332
+ }
333
+ if (op[0] & 5)
334
+ throw op[1];
335
+ return { value: op[0] ? op[1] : void 0, done: true };
336
+ }
337
+ }
338
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
339
+ if (k2 === undefined)
340
+ k2 = k;
341
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
342
+ }) : (function (o, m, k, k2) {
343
+ if (k2 === undefined)
344
+ k2 = k;
345
+ o[k2] = m[k];
346
+ });
347
+ function __exportStar(m, o) {
348
+ for (var p in m)
349
+ if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
350
+ __createBinding(o, m, p);
351
+ }
352
+ function __values(o) {
353
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
354
+ if (m)
355
+ return m.call(o);
356
+ if (o && typeof o.length === "number")
357
+ return {
358
+ next: function () {
359
+ if (o && i >= o.length)
360
+ o = void 0;
361
+ return { value: o && o[i++], done: !o };
362
+ }
363
+ };
364
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
365
+ }
366
+ function __read(o, n) {
367
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
368
+ if (!m)
369
+ return o;
370
+ var i = m.call(o), r, ar = [], e;
371
+ try {
372
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
373
+ ar.push(r.value);
374
+ }
375
+ catch (error) {
376
+ e = { error: error };
377
+ }
378
+ finally {
379
+ try {
380
+ if (r && !r.done && (m = i["return"]))
381
+ m.call(i);
382
+ }
383
+ finally {
384
+ if (e)
385
+ throw e.error;
386
+ }
387
+ }
388
+ return ar;
389
+ }
390
+ /** @deprecated */
391
+ function __spread() {
392
+ for (var ar = [], i = 0; i < arguments.length; i++)
393
+ ar = ar.concat(__read(arguments[i]));
394
+ return ar;
395
+ }
396
+ /** @deprecated */
397
+ function __spreadArrays() {
398
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
399
+ s += arguments[i].length;
400
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
401
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
402
+ r[k] = a[j];
403
+ return r;
404
+ }
405
+ function __spreadArray(to, from, pack) {
406
+ if (pack || arguments.length === 2)
407
+ for (var i = 0, l = from.length, ar; i < l; i++) {
408
+ if (ar || !(i in from)) {
409
+ if (!ar)
410
+ ar = Array.prototype.slice.call(from, 0, i);
411
+ ar[i] = from[i];
412
+ }
413
+ }
414
+ return to.concat(ar || Array.prototype.slice.call(from));
415
+ }
416
+ function __await(v) {
417
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
418
+ }
419
+ function __asyncGenerator(thisArg, _arguments, generator) {
420
+ if (!Symbol.asyncIterator)
421
+ throw new TypeError("Symbol.asyncIterator is not defined.");
422
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
423
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
424
+ function verb(n) { if (g[n])
425
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
426
+ function resume(n, v) { try {
427
+ step(g[n](v));
428
+ }
429
+ catch (e) {
430
+ settle(q[0][3], e);
431
+ } }
432
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
433
+ function fulfill(value) { resume("next", value); }
434
+ function reject(value) { resume("throw", value); }
435
+ function settle(f, v) { if (f(v), q.shift(), q.length)
436
+ resume(q[0][0], q[0][1]); }
437
+ }
438
+ function __asyncDelegator(o) {
439
+ var i, p;
440
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
441
+ function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
442
+ }
443
+ function __asyncValues(o) {
444
+ if (!Symbol.asyncIterator)
445
+ throw new TypeError("Symbol.asyncIterator is not defined.");
446
+ var m = o[Symbol.asyncIterator], i;
447
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
448
+ function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
449
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
450
+ }
451
+ function __makeTemplateObject(cooked, raw) {
452
+ if (Object.defineProperty) {
453
+ Object.defineProperty(cooked, "raw", { value: raw });
454
+ }
455
+ else {
456
+ cooked.raw = raw;
457
+ }
458
+ return cooked;
459
+ }
460
+ ;
461
+ var __setModuleDefault = Object.create ? (function (o, v) {
462
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
463
+ }) : function (o, v) {
464
+ o["default"] = v;
465
+ };
466
+ function __importStar(mod) {
467
+ if (mod && mod.__esModule)
468
+ return mod;
469
+ var result = {};
470
+ if (mod != null)
471
+ for (var k in mod)
472
+ if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
473
+ __createBinding(result, mod, k);
474
+ __setModuleDefault(result, mod);
475
+ return result;
476
+ }
477
+ function __importDefault(mod) {
478
+ return (mod && mod.__esModule) ? mod : { default: mod };
479
+ }
480
+ function __classPrivateFieldGet(receiver, state, kind, f) {
481
+ if (kind === "a" && !f)
482
+ throw new TypeError("Private accessor was defined without a getter");
483
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
484
+ throw new TypeError("Cannot read private member from an object whose class did not declare it");
485
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
486
+ }
487
+ function __classPrivateFieldSet(receiver, state, value, kind, f) {
488
+ if (kind === "m")
489
+ throw new TypeError("Private method is not writable");
490
+ if (kind === "a" && !f)
491
+ throw new TypeError("Private accessor was defined without a setter");
492
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
493
+ throw new TypeError("Cannot write private member to an object whose class did not declare it");
494
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
495
+ }
496
+
497
+ var EMOJIS = {
498
+ "grinning": {
499
+ "keywords": ["face", "smile", "happy", "joy", ":D", "grin"],
500
+ "char": "😀",
501
+ "category": "people"
502
+ },
503
+ "grimacing": {
504
+ "keywords": ["face", "grimace", "teeth"],
505
+ "char": "😬",
506
+ "category": "people"
507
+ },
508
+ "grin": {
509
+ "keywords": ["face", "happy", "smile", "joy", "kawaii"],
510
+ "char": "😁",
511
+ "category": "people"
512
+ },
513
+ "joy": {
514
+ "keywords": ["face", "cry", "tears", "weep", "happy", "happytears", "haha"],
515
+ "char": "😂",
516
+ "category": "people"
517
+ },
518
+ "smiley": {
519
+ "keywords": ["face", "happy", "joy", "haha", ":D", ":)", "smile", "funny"],
520
+ "char": "😃",
521
+ "category": "people"
522
+ },
523
+ "smile": {
524
+ "keywords": ["face", "happy", "joy", "funny", "haha", "laugh", "like", ":D", ":)"],
525
+ "char": "😄",
526
+ "category": "people"
527
+ },
528
+ "sweat_smile": {
529
+ "keywords": ["face", "hot", "happy", "laugh", "sweat", "smile", "relief"],
530
+ "char": "😅",
531
+ "category": "people"
532
+ },
533
+ "laughing": {
534
+ "keywords": ["happy", "joy", "lol", "satisfied", "haha", "face", "glad", "XD", "laugh"],
535
+ "char": "😆",
536
+ "category": "people"
537
+ },
538
+ "innocent": {
539
+ "keywords": ["face", "angel", "heaven", "halo"],
540
+ "char": "😇",
541
+ "category": "people"
542
+ },
543
+ "wink": {
544
+ "keywords": ["face", "happy", "mischievous", "secret", ";)", "smile"],
545
+ "char": "😉",
546
+ "category": "people"
547
+ },
548
+ "blush": {
549
+ "keywords": ["face", "smile", "happy", "flushed", "crush", "embarrassed", "shy", "joy"],
550
+ "char": "😊",
551
+ "category": "people"
552
+ },
553
+ "slightly_smiling": {
554
+ "keywords": ["face", "smile"],
555
+ "char": "🙂",
556
+ "category": "people"
557
+ },
558
+ "upside_down": {
559
+ "keywords": ["face", "flipped", "silly", "smile"],
560
+ "char": "🙃",
561
+ "category": "people"
562
+ },
563
+ "relaxed": {
564
+ "keywords": ["face", "blush", "massage", "happiness"],
565
+ "char": "☺️",
566
+ "category": "people"
567
+ },
568
+ "yum": {
569
+ "keywords": ["happy", "joy", "tongue", "smile", "face", "silly", "yummy", "nom"],
570
+ "char": "😋",
571
+ "category": "people"
572
+ },
573
+ "relieved": {
574
+ "keywords": ["face", "relaxed", "phew", "massage", "happiness"],
575
+ "char": "😌",
576
+ "category": "people"
577
+ },
578
+ "heart_eyes": {
579
+ "keywords": ["face", "love", "like", "affection", "valentines", "infatuation", "crush", "heart"],
580
+ "char": "😍",
581
+ "category": "people"
582
+ },
583
+ "kissing_heart": {
584
+ "keywords": ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"],
585
+ "char": "😘",
586
+ "category": "people"
587
+ },
588
+ "kissing": {
589
+ "keywords": ["love", "like", "face", "3", "valentines", "infatuation", "kiss"],
590
+ "char": "😗",
591
+ "category": "people"
592
+ },
593
+ "kissing_smiling_eyes": {
594
+ "keywords": ["face", "affection", "valentines", "infatuation", "kiss"],
595
+ "char": "😙",
596
+ "category": "people"
597
+ },
598
+ "kissing_closed_eyes": {
599
+ "keywords": ["face", "love", "like", "affection", "valentines", "infatuation", "kiss"],
600
+ "char": "😚",
500
601
  "category": "people"
501
602
  },
502
603
  "stuck_out_tongue_winking_eye": {
@@ -6929,7 +7030,7 @@
6929
7030
  try {
6930
7031
  for (var _b = __values(this.pairs(EMOJIS)), _c = _b.next(); !_c.done; _c = _b.next()) {
6931
7032
  var pair = _c.value;
6932
- var name_1 = pair[0];
7033
+ var name = pair[0];
6933
7034
  var emoji = pair[1];
6934
7035
  if (!cats[emoji.category]) {
6935
7036
  cats[emoji.category] = {
@@ -6951,23 +7052,21 @@
6951
7052
  }
6952
7053
  this.categories = this.pairs(cats).map(function (pair) { return pair[1]; });
6953
7054
  };
6954
- EmojiSelectorPanelComponent.ctorParameters = function () { return [
6955
- { type: platformBrowser.DomSanitizer }
6956
- ]; };
6957
- __decorate([
6958
- core.Output(),
6959
- __metadata("design:type", rxjs.Subject)
6960
- ], EmojiSelectorPanelComponent.prototype, "selected", void 0);
6961
- EmojiSelectorPanelComponent = __decorate([
6962
- core.Component({
6963
- selector: 'emoji-selector-panel',
6964
- template: "<div class=\"categories\">\r\n\t<a title=\"{{category.name}}\" mat-icon-button *ngFor=\"let category of categories\" (click)=\"activeCategory = category.name\">\r\n\t\t<mat-icon>{{category.icon}}</mat-icon>\r\n\t</a>\r\n</div>\r\n\r\n<div *ngFor=\"let category of categories\">\r\n\t<div class=\"emoji-list\" *ngIf=\"activeCategory && activeCategory == category.name\">\r\n\t\t<a href=\"javascript:;\" (click)=\"select(emoji.char)\" *ngFor=\"let emoji of category.emojis\" [innerHtml]=\"emoji.html || ''\">\r\n\t\t</a>\r\n\t</div>\r\n</div>",
6965
- styles: [":host{background:#111;border:1px solid #333;border-radius:5px;padding:.5em;display:flex;flex-direction:column;width:calc(8*(32px + 1em))}.emoji-list{flex-grow:1;overflow-y:auto;height:20em}.emoji-list a{display:inline-block;padding:2px;margin:4px;background-color:#111}.emoji-list a ::ng-deep .emoji{width:32px;height:32px}.emoji-list a:hover{background-color:#333}"]
6966
- }),
6967
- __metadata("design:paramtypes", [platformBrowser.DomSanitizer])
6968
- ], EmojiSelectorPanelComponent);
6969
7055
  return EmojiSelectorPanelComponent;
6970
- }());
7056
+ }());
7057
+ EmojiSelectorPanelComponent.decorators = [
7058
+ { type: core.Component, args: [{
7059
+ selector: 'emoji-selector-panel',
7060
+ template: "<div class=\"categories\">\r\n\t<a title=\"{{category.name}}\" mat-icon-button *ngFor=\"let category of categories\" (click)=\"activeCategory = category.name\">\r\n\t\t<mat-icon>{{category.icon}}</mat-icon>\r\n\t</a>\r\n</div>\r\n\r\n<div *ngFor=\"let category of categories\">\r\n\t<div class=\"emoji-list\" *ngIf=\"activeCategory && activeCategory == category.name\">\r\n\t\t<a href=\"javascript:;\" (click)=\"select(emoji.char)\" *ngFor=\"let emoji of category.emojis\" [innerHtml]=\"emoji.html || ''\">\r\n\t\t</a>\r\n\t</div>\r\n</div>",
7061
+ styles: [":host{background:#111;border:1px solid #333;border-radius:5px;display:flex;flex-direction:column;padding:.5em;width:calc(256px + 8em)}.emoji-list{flex-grow:1;height:20em;overflow-y:auto}.emoji-list a{background-color:#111;display:inline-block;margin:4px;padding:2px}.emoji-list a ::ng-deep .emoji{height:32px;width:32px}.emoji-list a:hover{background-color:#333}"]
7062
+ },] }
7063
+ ];
7064
+ EmojiSelectorPanelComponent.ctorParameters = function () { return [
7065
+ { type: platformBrowser.DomSanitizer }
7066
+ ]; };
7067
+ EmojiSelectorPanelComponent.propDecorators = {
7068
+ selected: [{ type: core.Output }]
7069
+ };
6971
7070
 
6972
7071
  var EmojiSelectorButtonComponent = /** @class */ (function () {
6973
7072
  function EmojiSelectorButtonComponent() {
@@ -6978,7 +7077,7 @@
6978
7077
  get: function () {
6979
7078
  return this._selected;
6980
7079
  },
6981
- enumerable: true,
7080
+ enumerable: false,
6982
7081
  configurable: true
6983
7082
  });
6984
7083
  EmojiSelectorButtonComponent.prototype.ngOnDestroy = function () {
@@ -7014,20 +7113,18 @@
7014
7113
  EmojiSelectorButtonComponent.prototype.insert = function (str) {
7015
7114
  this._selected.next(str);
7016
7115
  };
7017
- __decorate([
7018
- core.Output(),
7019
- __metadata("design:type", rxjs.Observable),
7020
- __metadata("design:paramtypes", [])
7021
- ], EmojiSelectorButtonComponent.prototype, "selected", null);
7022
- EmojiSelectorButtonComponent = __decorate([
7023
- core.Component({
7024
- selector: 'emoji-selector-button',
7025
- template: "\n <button mat-icon-button (click)=\"show()\">\n <mat-icon>emoji_emotions</mat-icon>\n </button>\n <emoji-selector-panel \n (selected)=\"insert($event)\"\n [class.visible]=\"showEmojiPanel\"\n ></emoji-selector-panel>\n ",
7026
- styles: ["\n :host {\n display: block;\n position: relative;\n }\n\n emoji-selector-panel {\n position: absolute;\n bottom: 2.5em;\n right: 0;\n opacity: 0;\n pointer-events: none;\n z-index: 10;\n }\n\n emoji-selector-panel.visible {\n pointer-events: initial;\n opacity: 1;\n }\n\n button {\n color: #666\n }\n\n :host.bottom-left emoji-selector-panel {\n right: auto;\n left: 0;\n }\n\n :host.top-right emoji-selector-panel {\n top: 2.4em;\n bottom: auto;\n }\n\n :host.top-left emoji-selector-panel {\n top: 2.4em;\n bottom: auto;\n left: 0;\n right: auto;\n }\n "]
7027
- })
7028
- ], EmojiSelectorButtonComponent);
7029
7116
  return EmojiSelectorButtonComponent;
7030
- }());
7117
+ }());
7118
+ EmojiSelectorButtonComponent.decorators = [
7119
+ { type: core.Component, args: [{
7120
+ selector: 'emoji-selector-button',
7121
+ template: "\n <button mat-icon-button (click)=\"show()\">\n <mat-icon>emoji_emotions</mat-icon>\n </button>\n <emoji-selector-panel \n (selected)=\"insert($event)\"\n [class.visible]=\"showEmojiPanel\"\n ></emoji-selector-panel>\n ",
7122
+ styles: ["\n :host {\n display: block;\n position: relative;\n }\n\n emoji-selector-panel {\n position: absolute;\n bottom: 2.5em;\n right: 0;\n opacity: 0;\n pointer-events: none;\n z-index: 10;\n }\n\n emoji-selector-panel.visible {\n pointer-events: initial;\n opacity: 1;\n }\n\n button {\n color: #666\n }\n\n :host.bottom-left emoji-selector-panel {\n right: auto;\n left: 0;\n }\n\n :host.top-right emoji-selector-panel {\n top: 2.4em;\n bottom: auto;\n }\n\n :host.top-left emoji-selector-panel {\n top: 2.4em;\n bottom: auto;\n left: 0;\n right: auto;\n }\n "]
7123
+ },] }
7124
+ ];
7125
+ EmojiSelectorButtonComponent.propDecorators = {
7126
+ selected: [{ type: core.Output }]
7127
+ };
7031
7128
 
7032
7129
  var COMPONENTS$1 = [
7033
7130
  EmojiSelectorPanelComponent,
@@ -7036,53 +7133,324 @@
7036
7133
  var EmojiModule = /** @class */ (function () {
7037
7134
  function EmojiModule() {
7038
7135
  }
7039
- EmojiModule = __decorate([
7040
- core.NgModule({
7041
- declarations: COMPONENTS$1,
7042
- imports: [
7043
- common.CommonModule,
7044
- icon.MatIconModule,
7045
- button.MatButtonModule
7046
- ],
7047
- exports: COMPONENTS$1
7048
- })
7049
- ], EmojiModule);
7050
7136
  return EmojiModule;
7051
- }());
7137
+ }());
7138
+ EmojiModule.decorators = [
7139
+ { type: core.NgModule, args: [{
7140
+ declarations: COMPONENTS$1,
7141
+ imports: [
7142
+ common.CommonModule,
7143
+ icon.MatIconModule,
7144
+ button.MatButtonModule
7145
+ ],
7146
+ exports: COMPONENTS$1
7147
+ },] }
7148
+ ];
7052
7149
 
7053
- var ChatMessageComponent = /** @class */ (function () {
7054
- function ChatMessageComponent() {
7055
- this._selected = new rxjs.Subject();
7056
- this._reported = new rxjs.Subject();
7057
- this._upvoted = new rxjs.Subject();
7058
- this._userSelected = new rxjs.Subject();
7059
- }
7060
- Object.defineProperty(ChatMessageComponent.prototype, "userSelected", {
7061
- get: function () {
7150
+ /**
7151
+ * Unified chat and comments component
7152
+ */
7153
+ var BantaComponent = /** @class */ (function () {
7154
+ function BantaComponent(banta, backend, matDialog) {
7155
+ this.banta = banta;
7156
+ this.backend = backend;
7157
+ this.matDialog = matDialog;
7158
+ this._subs = new subsink.SubSink();
7159
+ this.auxOpen = false;
7160
+ this.auxTitle = 'Notifications';
7161
+ this.auxMode = 'notifications';
7162
+ this.mobileFocus = null;
7163
+ this.newNotifications = false;
7164
+ this.chatLabel = 'Chat';
7165
+ this.commentsLabel = 'Comments';
7166
+ this._signInSelected = new rxjs.Subject();
7167
+ this.pointOpen = null;
7168
+ this.pointSubChat = null;
7169
+ this.newPointSubMessage = {};
7170
+ this.genericAvatarUrl = 'https://gravatar.com/avatar/915c804e0be607a4ad766ddadea5c48a?s=512&d=https://codepen.io/assets/avatars/user-avatar-512x512-6e240cf350d2f1cc07c2bed234c3a3bb5f1b237023c204c782622e80d6b212ba.png';
7171
+ // this.firehoseSource = new MockFirehoseSource();
7172
+ // this.pointSource = new MockPointSource();
7173
+ }
7174
+ BantaComponent.prototype.ngOnInit = function () {
7175
+ var _this = this;
7176
+ this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.currentUser = user; }), this.backend.notificationsChanged.subscribe(function (notifs) { return _this.notifications = notifs; }), this.backend.newNotification.subscribe(function (notif) {
7177
+ _this.newNotifications = true;
7178
+ }));
7179
+ };
7180
+ BantaComponent.prototype.sendPointSubMessage = function () {
7181
+ return __awaiter(this, void 0, void 0, function () {
7182
+ var text, message, e_1;
7183
+ return __generator(this, function (_a) {
7184
+ switch (_a.label) {
7185
+ case 0:
7186
+ text = (this.newPointSubMessage.message || '').trim();
7187
+ this.newPointSubMessage.message = '';
7188
+ if (text === '')
7189
+ return [2 /*return*/];
7190
+ message = {
7191
+ user: null,
7192
+ sentAt: Date.now(),
7193
+ upvotes: 0,
7194
+ message: text
7195
+ };
7196
+ _a.label = 1;
7197
+ case 1:
7198
+ _a.trys.push([1, 3, , 4]);
7199
+ return [4 /*yield*/, this.pointSubChat.send(message)];
7200
+ case 2:
7201
+ _a.sent();
7202
+ return [3 /*break*/, 4];
7203
+ case 3:
7204
+ e_1 = _a.sent();
7205
+ console.error("Failed to send point sub-message:");
7206
+ console.error(e_1);
7207
+ return [3 /*break*/, 4];
7208
+ case 4: return [2 /*return*/];
7209
+ }
7210
+ });
7211
+ });
7212
+ };
7213
+ BantaComponent.prototype.goToMessage = function (message) {
7214
+ return __awaiter(this, void 0, void 0, function () {
7215
+ var targetMessage, parentMessage, viewType, _a, _b;
7216
+ return __generator(this, function (_c) {
7217
+ switch (_c.label) {
7218
+ case 0:
7219
+ targetMessage = message;
7220
+ if (!message.parentMessageId) return [3 /*break*/, 2];
7221
+ return [4 /*yield*/, this.backend.getMessage(message.topicId, message.parentMessageId)];
7222
+ case 1:
7223
+ parentMessage = _c.sent();
7224
+ if (!parentMessage) {
7225
+ console.error("Failed to look up parent message " + message.topicId + "/" + message.parentMessageId);
7226
+ console.error("Original message was:");
7227
+ console.dir(targetMessage);
7228
+ return [2 /*return*/];
7229
+ }
7230
+ message = parentMessage;
7231
+ _c.label = 2;
7232
+ case 2:
7233
+ viewType = this.getViewType(message);
7234
+ if (!(viewType === 'comment')) return [3 /*break*/, 5];
7235
+ if (this.pointSubChat) {
7236
+ if (this.pointSubChat.close)
7237
+ this.pointSubChat.close();
7238
+ this.pointSubChat = null;
7239
+ }
7240
+ this.mobileFocus = 'points';
7241
+ this.pointOpen = message;
7242
+ _a = this;
7243
+ return [4 /*yield*/, this.backend.getSourceForThread(message.topicId, message.id)];
7244
+ case 3:
7245
+ _a.pointSubChat = _c.sent();
7246
+ _b = this;
7247
+ return [4 /*yield*/, this.backend.refreshMessage(message)];
7248
+ case 4:
7249
+ _b.pointOpen = _c.sent();
7250
+ this.newPointSubMessage = {};
7251
+ return [3 /*break*/, 6];
7252
+ case 5:
7253
+ if (viewType === 'chat') {
7254
+ this.mobileFocus = 'firehose';
7255
+ this.firehose.jumpToMessage(message);
7256
+ }
7257
+ _c.label = 6;
7258
+ case 6: return [2 /*return*/];
7259
+ }
7260
+ });
7261
+ });
7262
+ };
7263
+ BantaComponent.prototype.pointUnfocus = function () {
7264
+ this.pointOpen = null;
7265
+ if (this.pointSubChat) {
7266
+ if (this.pointSubChat.close)
7267
+ this.pointSubChat.close();
7268
+ this.pointSubChat = null;
7269
+ }
7270
+ };
7271
+ BantaComponent.prototype.ngOnDestroy = function () {
7272
+ this._subs.unsubscribe();
7273
+ };
7274
+ BantaComponent.prototype.showAux = function (title, mode) {
7275
+ this.auxOpen = true;
7276
+ this.auxTitle = title;
7277
+ this.auxMode = mode;
7278
+ this.mobileFocus = 'aux';
7279
+ };
7280
+ BantaComponent.prototype.showNotifications = function () {
7281
+ this.showAux('Notifications', 'notifications');
7282
+ };
7283
+ Object.defineProperty(BantaComponent.prototype, "topicID", {
7284
+ get: function () {
7285
+ return this._topicID;
7286
+ },
7287
+ set: function (value) {
7288
+ this._topicID = value;
7289
+ this.close();
7290
+ this.connectToTopic(this._topicID);
7291
+ },
7292
+ enumerable: false,
7293
+ configurable: true
7294
+ });
7295
+ BantaComponent.prototype.connectToTopic = function (id) {
7296
+ return __awaiter(this, void 0, void 0, function () {
7297
+ var _a, _b;
7298
+ return __generator(this, function (_c) {
7299
+ switch (_c.label) {
7300
+ case 0:
7301
+ _a = this;
7302
+ return [4 /*yield*/, this.backend.getSourceForTopic(id + "_firehose")];
7303
+ case 1:
7304
+ _a.firehoseSource = _c.sent();
7305
+ _b = this;
7306
+ return [4 /*yield*/, this.backend.getSourceForTopic(id + "_thepoint")];
7307
+ case 2:
7308
+ _b.pointSource = _c.sent();
7309
+ return [2 /*return*/];
7310
+ }
7311
+ });
7312
+ });
7313
+ };
7314
+ Object.defineProperty(BantaComponent.prototype, "signInSelected", {
7315
+ get: function () {
7316
+ return this._signInSelected;
7317
+ },
7318
+ enumerable: false,
7319
+ configurable: true
7320
+ });
7321
+ BantaComponent.prototype.showSignIn = function () {
7322
+ this._signInSelected.next();
7323
+ };
7324
+ BantaComponent.prototype.close = function () {
7325
+ if (this.firehoseSource) {
7326
+ if (this.firehoseSource.close)
7327
+ this.firehoseSource.close();
7328
+ this.firehoseSource = null;
7329
+ }
7330
+ if (this.pointSource) {
7331
+ if (this.pointSource.close)
7332
+ this.pointSource.close();
7333
+ this.pointSource = null;
7334
+ }
7335
+ };
7336
+ Object.defineProperty(BantaComponent.prototype, "hasPoint", {
7337
+ get: function () {
7338
+ return this.pointOpen != null;
7339
+ },
7340
+ enumerable: false,
7341
+ configurable: true
7342
+ });
7343
+ BantaComponent.prototype.closeAux = function () {
7344
+ this.auxOpen = false;
7345
+ this.mobileFocus = 'firehose';
7346
+ };
7347
+ BantaComponent.prototype.getViewType = function (message) {
7348
+ if (message.topicId.endsWith('_firehose'))
7349
+ return 'chat';
7350
+ else if (message.topicId.endsWith('_thepoint'))
7351
+ return 'comment';
7352
+ return 'comment';
7353
+ };
7354
+ BantaComponent.prototype.upvoteMessage = function (message) {
7355
+ return __awaiter(this, void 0, void 0, function () {
7356
+ return __generator(this, function (_a) {
7357
+ switch (_a.label) {
7358
+ case 0:
7359
+ if (!message.parentMessageId) return [3 /*break*/, 2];
7360
+ return [4 /*yield*/, this.backend.upvoteMessage(message.topicId, message.parentMessageId, message.id)];
7361
+ case 1:
7362
+ _a.sent();
7363
+ return [3 /*break*/, 4];
7364
+ case 2: return [4 /*yield*/, this.backend.upvoteMessage(message.topicId, message.id)];
7365
+ case 3:
7366
+ _a.sent();
7367
+ _a.label = 4;
7368
+ case 4: return [2 /*return*/];
7369
+ }
7370
+ });
7371
+ });
7372
+ };
7373
+ BantaComponent.prototype.showProfile = function (user) {
7374
+ this.profileUser = user;
7375
+ this.showAux("@" + user.username + "'s Profile", 'profile');
7376
+ };
7377
+ BantaComponent.prototype.sendReport = function (message) {
7378
+ this.auxOpen = false;
7379
+ alert('would send report');
7380
+ };
7381
+ BantaComponent.prototype.reportMessage = function (message) {
7382
+ this.reportedMessage = message;
7383
+ this.showAux("Report message from @" + message.user.username, 'report');
7384
+ };
7385
+ return BantaComponent;
7386
+ }());
7387
+ BantaComponent.decorators = [
7388
+ { type: core.Component, args: [{
7389
+ selector: "banta",
7390
+ template: "\r\n<mat-menu #userMenu=\"matMenu\">\r\n <ng-container *ngIf=\"currentUser\">\r\n <button [disabled]=\"true\" mat-menu-item>{{currentUser.displayName}} (@{{currentUser.username}})</button>\r\n <button mat-menu-item (click)=\"signOut()\">Sign Out</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"!currentUser\">\r\n <button mat-menu-item>Sign In</button>\r\n </ng-container>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"tabs\">\r\n <div>\r\n <a mat-button (click)=\"mobileFocus = 'chat'\">{{chatLabel}}</a>\r\n <a mat-button (click)=\"mobileFocus = 'comments'\">{{commentsLabel}}</a>\r\n </div>\r\n <div class=\"spacer\"></div>\r\n <div>\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div class=\"firehose\" [class.focus]=\"mobileFocus === 'chat'\">\r\n <header>\r\n <div>\r\n <label (click)=\"mobileFocus = 'chat'\">{{chatLabel}}</label>\r\n <div class=\"spacer\"></div>\r\n\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n </header>\r\n <banta-chat \r\n #firehose\r\n [source]=\"firehoseSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></banta-chat>\r\n</div>\r\n\r\n<div class=\"aux\" [class.focus]=\"mobileFocus === 'aux'\" [class.open]=\"auxOpen\">\r\n <header>\r\n <div>\r\n <label>{{auxTitle}}</label>\r\n <div class=\"spacer\"></div>\r\n <button mat-icon-button (click)=\"auxOpen = false\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </header>\r\n <div class=\"aux-contents\">\r\n <ng-container *ngIf=\"auxMode === 'profile'\">\r\n <ng-container *ngIf=\"profileUser\">\r\n\r\n <div>\r\n <strong style=\"font-size: 125%;\">\r\n {{profileUser.displayName}}\r\n </strong>\r\n @{{profileUser.username}}\r\n </div>\r\n\r\n <br/>\r\n <strong>Top Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <br/>\r\n <strong>Recent Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <pre>{{profileUser | json}}</pre>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'report'\">\r\n <p>Are you sure you want to report this message?</p>\r\n\r\n <banta-live-message [message]=\"reportedMessage\"></banta-live-message>\r\n\r\n <div style=\"text-align: center;\">\r\n <button mat-raised-button color=\"primary\" (click)=\"sendReport(reportedMessage)\">Yes, Report</button>\r\n &nbsp;\r\n <button mat-raised-button color=\"secondary\" (click)=\"auxOpen = false\">No, Cancel</button>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'notifications'\">\r\n\r\n <div *ngIf=\"!notifications || notifications.length === 0\">\r\n <em>You do not have any notifications yet</em>\r\n </div>\r\n \r\n <div class=\"notifications\">\r\n <div class=\"notification\" *ngFor=\"let notif of notifications\">\r\n <div>\r\n <ng-container *ngIf=\"notif.type === 'upvote'\">\r\n @{{notif.message?.user?.username}} upvoted your post\r\n \r\n <banta-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </banta-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'notice'\">\r\n <div>\r\n {{notif.message}}\r\n </div>\r\n <a mat-button target=\"_blank\" href=\"{{notif.actionUrl}}\">\r\n {{notif.actionLabel}}\r\n </a>\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'mention'\">\r\n You were mentioned by @{{notif.message?.user?.username}}\r\n\r\n <banta-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </banta-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'reply'\">\r\n @{{notif.replyMessage?.user?.username}} replied to your post\r\n \r\n <banta-live-message\r\n [message]=\"notif.replyMessage\"\r\n (upvoted)=\"upvoteMessage(notif.replyMessage)\"\r\n (reported)=\"reportMessage(notif.replyMessage)\"\r\n (selected)=\"goToMessage(notif.replyMessage)\">\r\n </banta-live-message>\r\n </ng-container>\r\n </div>\r\n\r\n <banta-timestamp [value]=\"notif.sentAt\"></banta-timestamp>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<div class=\"points\" [class.focus]=\"mobileFocus === 'points'\">\r\n <header>\r\n <div>\r\n <label>{{commentsLabel}}</label>\r\n </div>\r\n </header>\r\n <div class=\"point-focus\">\r\n <div class=\"actions\">\r\n <button mat-button (click)=\"pointUnfocus()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Back\r\n </button>\r\n\r\n <div class=\"spacer\"></div>\r\n \r\n <ng-container *ngIf=\"pointOpen\">\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\"> \r\n {{pointOpen.upvotes}}\r\n </div>\r\n <button mat-icon-button>\r\n <mat-icon>thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"!pointSubChat\">\r\n Error: No subchat\r\n </div>\r\n \r\n <banta-comment-view\r\n class=\"subcomments\"\r\n *ngIf=\"pointSubChat\"\r\n [newestLast]=\"true\"\r\n [allowReplies]=\"false\"\r\n [source]=\"pointSubChat\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n >\r\n \r\n <banta-comment\r\n class=\"focused-comment\"\r\n data-before\r\n *ngIf=\"pointOpen\"\r\n (upvoted)=\"upvoteMessage(pointOpen)\"\r\n (userSelected)=\"showProfile(pointOpen.user)\"\r\n (reported)=\"reportMessage(pointOpen)\"\r\n [showReplyAction]=\"false\"\r\n [message]=\"pointOpen\"\r\n ></banta-comment>\r\n \r\n <div class=\"message reply\">\r\n Reply:\r\n <form class=\"new-message\" (submit)=\"sendPointSubMessage()\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"newPointSubMessageKeyDown($event)\"\r\n [(ngModel)]=\"newPointSubMessage.message\"></textarea>\r\n \r\n <div class=\"actions\">\r\n <button [disabled]=\"!newPointSubMessage.message\" \r\n mat-raised-button color=\"primary\">Send</button>\r\n </div>\r\n </form>\r\n </div>\r\n </banta-comment-view>\r\n </div>\r\n <div class=\"points-section\">\r\n <banta-comments\r\n [source]=\"pointSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (selected)=\"goToMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n ></banta-comments>\r\n </div>\r\n</div>",
7391
+ styles: [":host{display:flex;flex-direction:row;height:40em;padding:.5em;position:relative}.counted-action{align-items:center;display:flex}.count-indicator{border:1px solid #333;border-radius:3px;font-size:9pt;padding:0 3px}header{margin-bottom:1em;position:relative}header div{align-items:center;display:flex;height:30px}header button{color:#666}header label{color:#333;font-size:12pt;font-weight:100;letter-spacing:2px;margin:0 auto 0 0;overflow-x:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;z-index:1}header:after,header label{display:block;position:relative}header:after{border:1px solid #ccc;content:\"\";height:0;width:100%;z-index:0}.points{display:flex;flex-direction:column;max-width:50em}:host.point-focus .points{max-width:50em;width:66%}:host.point-focus .points .points-section{opacity:0;pointer-events:none}:host.point-focus .points .point-focus{opacity:1;pointer-events:auto}:host.point-focus .points .point-focus .actions{display:flex}banta-comments{flex-grow:1}.points{flex-shrink:0;font-size:12pt;margin-left:.5em;max-width:30em;position:relative;transition:width .2s ease-in,max-width .2s ease-in;width:33%}.points .points-section{opacity:1;z-index:2}.points .point-focus,.points .points-section{display:flex;flex-direction:column;flex-grow:1;transition:opacity .2s ease-in}.points .point-focus{bottom:0;left:0;opacity:0;padding:.5em;position:absolute;right:0;top:1.75em;width:100%}.firehose{display:flex;flex-direction:column;flex-grow:1;font-size:10pt}form{align-items:center;display:flex;padding:.5em 0}form textarea{font-size:14pt;min-height:6em}form input[type=text],form textarea{background:#000;border:1px solid #333;color:#fff;width:100%}form input[type=text]{height:1em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}.subcomments ::ng-deep banta-comment{font-size:10pt}.subcomments ::ng-deep banta-comment.focused-comment{background:#001321;color:#fff;font-size:12pt}.aux{display:flex;flex-direction:column;min-width:0;overflow-x:hidden;transition:width .4s ease-out,min-width .4s ease-out;width:0}.aux.open{min-width:18em;width:30em}.aux .aux-contents{align-items:center;display:flex;flex-direction:column;flex-grow:1;justify-content:center;max-width:100%;min-width:10em;width:30em}.notifications .notification{border-bottom:1px solid #333;padding:1em}.notifications .notification banta-timestamp{color:#999;display:block;font-size:9pt;text-align:right}.message.reply{padding:1em}.tabs{display:none}@media (max-width:1015px){:host{flex-direction:column}.tabs{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:rgba(0,0,0,.5);display:flex;left:0;position:absolute;right:0;top:0;width:100%;z-index:10}.points{margin-left:0;max-width:100%;width:100%}header{display:none}.aux,:host.point-focus .points{max-width:100%;width:100%}.aux{min-width:0}.aux,.firehose,.points{background:#000;bottom:0;left:0;position:absolute;right:0;top:2em;z-index:0}.aux.focus,.firehose.focus,.points.focus{z-index:2}}:host-context(.mat-dark-theme) :host{background:#090909;color:#fff}:host-context(.mat-dark-theme) form textarea{background:#ccc;color:#333}:host-context(.mat-dark-theme) header:after{border-color:#222}:host-context(.mat-dark-theme) header label{color:#aaa}"]
7392
+ },] }
7393
+ ];
7394
+ BantaComponent.ctorParameters = function () { return [
7395
+ { type: BantaService },
7396
+ { type: ChatBackendService },
7397
+ { type: dialog.MatDialog }
7398
+ ]; };
7399
+ BantaComponent.propDecorators = {
7400
+ firehose: [{ type: core.ViewChild, args: ['firehose', { static: true },] }],
7401
+ topicID: [{ type: core.Input }],
7402
+ chatLabel: [{ type: core.Input }],
7403
+ commentsLabel: [{ type: core.Input }],
7404
+ signInSelected: [{ type: core.Output }],
7405
+ hasPoint: [{ type: core.HostBinding, args: ['class.point-focus',] }]
7406
+ };
7407
+
7408
+ var BantaLogoComponent = /** @class */ (function () {
7409
+ function BantaLogoComponent() {
7410
+ }
7411
+ return BantaLogoComponent;
7412
+ }());
7413
+ BantaLogoComponent.decorators = [
7414
+ { type: core.Component, args: [{
7415
+ selector: 'banta-logo',
7416
+ template: "banta",
7417
+ styles: ["\n :host {\n font-family: 'Odibee Sans', sans-serif;\n font-size: 40pt;\n }\n\n :host.small {\n font-size: 30pt;\n }\n "]
7418
+ },] }
7419
+ ];
7420
+
7421
+ var ChatMessageComponent = /** @class */ (function () {
7422
+ function ChatMessageComponent() {
7423
+ this._selected = new rxjs.Subject();
7424
+ this._reported = new rxjs.Subject();
7425
+ this._upvoted = new rxjs.Subject();
7426
+ this._userSelected = new rxjs.Subject();
7427
+ }
7428
+ Object.defineProperty(ChatMessageComponent.prototype, "userSelected", {
7429
+ get: function () {
7062
7430
  return this._userSelected;
7063
7431
  },
7064
- enumerable: true,
7432
+ enumerable: false,
7065
7433
  configurable: true
7066
7434
  });
7067
7435
  Object.defineProperty(ChatMessageComponent.prototype, "selected", {
7068
7436
  get: function () {
7069
7437
  return this._selected;
7070
7438
  },
7071
- enumerable: true,
7439
+ enumerable: false,
7072
7440
  configurable: true
7073
7441
  });
7074
7442
  Object.defineProperty(ChatMessageComponent.prototype, "reported", {
7075
7443
  get: function () {
7076
7444
  return this._reported;
7077
7445
  },
7078
- enumerable: true,
7446
+ enumerable: false,
7079
7447
  configurable: true
7080
7448
  });
7081
7449
  Object.defineProperty(ChatMessageComponent.prototype, "upvoted", {
7082
7450
  get: function () {
7083
7451
  return this._upvoted;
7084
7452
  },
7085
- enumerable: true,
7453
+ enumerable: false,
7086
7454
  configurable: true
7087
7455
  });
7088
7456
  ChatMessageComponent.prototype.avatarForUser = function (user) {
@@ -7104,48 +7472,22 @@
7104
7472
  ChatMessageComponent.prototype.selectUser = function () {
7105
7473
  this._userSelected.next();
7106
7474
  };
7107
- __decorate([
7108
- core.Input(),
7109
- __metadata("design:type", Object)
7110
- ], ChatMessageComponent.prototype, "message", void 0);
7111
- __decorate([
7112
- core.Output(),
7113
- __metadata("design:type", Object),
7114
- __metadata("design:paramtypes", [])
7115
- ], ChatMessageComponent.prototype, "userSelected", null);
7116
- __decorate([
7117
- core.Output(),
7118
- __metadata("design:type", Object),
7119
- __metadata("design:paramtypes", [])
7120
- ], ChatMessageComponent.prototype, "selected", null);
7121
- __decorate([
7122
- core.Output(),
7123
- __metadata("design:type", Object),
7124
- __metadata("design:paramtypes", [])
7125
- ], ChatMessageComponent.prototype, "reported", null);
7126
- __decorate([
7127
- core.Output(),
7128
- __metadata("design:type", Object),
7129
- __metadata("design:paramtypes", [])
7130
- ], ChatMessageComponent.prototype, "upvoted", null);
7131
- ChatMessageComponent = __decorate([
7132
- core.Component({
7133
- selector: 'banta-chat-message',
7134
- template: "<div class=\"message-content\">\r\n <div class=\"user\" (click)=\"selectUser()\">\r\n <div class=\"avatar\" [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label>{{message.user.username}}</label>\r\n </div>\r\n <div class=\"content\">\r\n <div (click)=\"select()\">\r\n {{message.message}}\r\n </div>\r\n <div class=\"status\">\r\n <div class=\"count-indicator\" *ngIf=\"message.upvotes > 0\">\r\n {{message.upvotes}} <mat-icon [inline]=\"true\">star</mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"actions\">\r\n <button mat-icon-button matTooltip=\"Upvote\" matTooltipPosition=\"below\" (click)=\"upvote()\">\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n <button mat-icon-button matTooltip=\"Report\" matTooltipPosition=\"below\" (click)=\"report()\">\r\n <mat-icon [inline]=\"true\">report</mat-icon>\r\n </button>\r\n</div>",
7135
- styles: [":host{display:flex;flex-direction:row;align-items:center;padding:0 1em;background-color:#fff;color:#000;transition:background-color .4s ease-out}:host:hover{background-color:#ddd}:host.highlight{background:#00121b}:host.highlight:hover{background:#01324d}:host:nth-child(2n){background-color:#eee}:host:nth-child(2n):hover{background:#ddd}:host:nth-child(2n) .message-content .content{color:#222}:host:nth-child(2n).highlight{background:#001a2a}:host:nth-child(2n).highlight:hover{background:#002b44}:host .message-content{display:flex;flex-direction:row;flex-grow:1;align-items:center}:host .message-content .content{color:#111;display:flex;flex-direction:row;padding:5px 0}:host .message-content .content .status{display:flex;flex-direction:row;align-items:center;margin-left:1em}:host .message-content .content .status mat-icon{margin-left:.5em}:host .user{color:#999;font-weight:400;text-align:right;margin-right:.25em;flex-shrink:0;display:flex;align-items:center}:host .user .avatar{background-position:center;background-size:cover;background-color:#333;border-radius:100%;flex-shrink:0;flex-grow:0;margin-right:1em;width:2em;height:2em}:host .user:after{content:\":\";margin-right:1em}:host .content{flex-grow:1}:host .actions{flex-shrink:0;white-space:nowrap;opacity:0;transition:opacity .4s ease-out}:host:hover .actions{opacity:1}.count-indicator{white-space:nowrap}:host-context(.mat-dark-theme){background-color:#000;color:#fff}:host-context(.mat-dark-theme) .message-content .content{color:#ddd}:host-context(.mat-dark-theme):hover{background-color:#111}:host-context(.mat-dark-theme):nth-child(2n).highlight{background:#001a2a}:host-context(.mat-dark-theme):nth-child(2n).highlight:hover{background:#002b44}:host-context(.mat-dark-theme):nth-child(2n):hover{background-color:#111}:host-context(.mat-dark-theme):nth-child(2n){background-color:#080808}:host-context(.mat-dark-theme):nth-child(2n) .message-content .content{color:#eee}label{margin:0}"]
7136
- })
7137
- ], ChatMessageComponent);
7138
7475
  return ChatMessageComponent;
7139
- }());
7140
-
7141
- var ChatBackendService = /** @class */ (function () {
7142
- function ChatBackendService() {
7143
- }
7144
- ChatBackendService = __decorate([
7145
- core.Injectable()
7146
- ], ChatBackendService);
7147
- return ChatBackendService;
7148
- }());
7476
+ }());
7477
+ ChatMessageComponent.decorators = [
7478
+ { type: core.Component, args: [{
7479
+ selector: 'banta-chat-message',
7480
+ template: "<div class=\"message-content\">\r\n <div class=\"user\" (click)=\"selectUser()\">\r\n <div class=\"avatar\" [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label>{{message.user.username}}</label>\r\n </div>\r\n <div class=\"content\">\r\n <div (click)=\"select()\">\r\n {{message.message}}\r\n </div>\r\n <div class=\"status\">\r\n <div class=\"count-indicator\" *ngIf=\"message.upvotes > 0\">\r\n {{message.upvotes}} <mat-icon [inline]=\"true\">star</mat-icon>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n<div class=\"actions\">\r\n <button mat-icon-button matTooltip=\"Upvote\" matTooltipPosition=\"below\" (click)=\"upvote()\">\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n <button mat-icon-button matTooltip=\"Report\" matTooltipPosition=\"below\" (click)=\"report()\">\r\n <mat-icon [inline]=\"true\">report</mat-icon>\r\n </button>\r\n</div>",
7481
+ styles: [":host{align-items:center;background-color:#fff;color:#000;display:flex;flex-direction:row;padding:0 1em;transition:background-color .4s ease-out}:host .message-content .content{color:#111}:host:hover{background-color:#ddd}:host.highlight{background:#00121b}:host.highlight:hover{background:#01324d}:host:nth-child(2n){background-color:#eee}:host:nth-child(2n):hover{background:#ddd}:host:nth-child(2n) .message-content .content{color:#222}:host:nth-child(2n).highlight{background:#001a2a}:host:nth-child(2n).highlight:hover{background:#002b44}:host .message-content{align-items:center;display:flex;flex-direction:row;flex-grow:1}:host .message-content .content{display:flex;flex-direction:row;padding:5px 0}:host .message-content .content .status{align-items:center;display:flex;flex-direction:row;margin-left:1em}:host .message-content .content .status mat-icon{margin-left:.5em}:host .user{align-items:center;color:#999;display:flex;flex-shrink:0;font-weight:400;margin-right:.25em;text-align:right}:host .user .avatar{background-color:#333;background-position:50%;background-size:cover;border-radius:100%;flex-grow:0;flex-shrink:0;height:2em;margin-right:1em;width:2em}:host .user:after{content:\":\";margin-right:1em}:host .content{flex-grow:1}:host .actions{flex-shrink:0;opacity:0;transition:opacity .4s ease-out;white-space:nowrap}:host:hover .actions{opacity:1}.count-indicator{white-space:nowrap}:host-context(.mat-dark-theme){background-color:#000;color:#fff}:host-context(.mat-dark-theme) .message-content .content{color:#ddd}:host-context(.mat-dark-theme):hover{background-color:#111}:host-context(.mat-dark-theme):nth-child(2n).highlight{background:#001a2a}:host-context(.mat-dark-theme):nth-child(2n).highlight:hover{background:#002b44}:host-context(.mat-dark-theme):nth-child(2n):hover{background-color:#111}:host-context(.mat-dark-theme):nth-child(2n){background-color:#080808}:host-context(.mat-dark-theme):nth-child(2n) .message-content .content{color:#eee}label{margin:0}"]
7482
+ },] }
7483
+ ];
7484
+ ChatMessageComponent.propDecorators = {
7485
+ message: [{ type: core.Input }],
7486
+ userSelected: [{ type: core.Output }],
7487
+ selected: [{ type: core.Output }],
7488
+ reported: [{ type: core.Output }],
7489
+ upvoted: [{ type: core.Output }]
7490
+ };
7149
7491
 
7150
7492
  var LiveChatMessageComponent = /** @class */ (function () {
7151
7493
  function LiveChatMessageComponent(backend) {
@@ -7158,21 +7500,21 @@
7158
7500
  get: function () {
7159
7501
  return this._upvoted;
7160
7502
  },
7161
- enumerable: true,
7503
+ enumerable: false,
7162
7504
  configurable: true
7163
7505
  });
7164
7506
  Object.defineProperty(LiveChatMessageComponent.prototype, "reported", {
7165
7507
  get: function () {
7166
7508
  return this._reported;
7167
7509
  },
7168
- enumerable: true,
7510
+ enumerable: false,
7169
7511
  configurable: true
7170
7512
  });
7171
7513
  Object.defineProperty(LiveChatMessageComponent.prototype, "selected", {
7172
7514
  get: function () {
7173
7515
  return this._selected;
7174
7516
  },
7175
- enumerable: true,
7517
+ enumerable: false,
7176
7518
  configurable: true
7177
7519
  });
7178
7520
  Object.defineProperty(LiveChatMessageComponent.prototype, "message", {
@@ -7194,7 +7536,7 @@
7194
7536
  this.unsubscribe = this.backend.watchMessage(value, function (message) { return _this.message = message; });
7195
7537
  }
7196
7538
  },
7197
- enumerable: true,
7539
+ enumerable: false,
7198
7540
  configurable: true
7199
7541
  });
7200
7542
  LiveChatMessageComponent.prototype.report = function () {
@@ -7206,39 +7548,24 @@
7206
7548
  LiveChatMessageComponent.prototype.select = function () {
7207
7549
  this._selected.next();
7208
7550
  };
7209
- LiveChatMessageComponent.ctorParameters = function () { return [
7210
- { type: ChatBackendService }
7211
- ]; };
7212
- __decorate([
7213
- core.Output(),
7214
- __metadata("design:type", rxjs.Observable),
7215
- __metadata("design:paramtypes", [])
7216
- ], LiveChatMessageComponent.prototype, "upvoted", null);
7217
- __decorate([
7218
- core.Output(),
7219
- __metadata("design:type", rxjs.Observable),
7220
- __metadata("design:paramtypes", [])
7221
- ], LiveChatMessageComponent.prototype, "reported", null);
7222
- __decorate([
7223
- core.Output(),
7224
- __metadata("design:type", rxjs.Observable),
7225
- __metadata("design:paramtypes", [])
7226
- ], LiveChatMessageComponent.prototype, "selected", null);
7227
- __decorate([
7228
- core.Input(),
7229
- __metadata("design:type", Object),
7230
- __metadata("design:paramtypes", [Object])
7231
- ], LiveChatMessageComponent.prototype, "message", null);
7232
- LiveChatMessageComponent = __decorate([
7233
- core.Component({
7234
- selector: 'banta-live-chat-message',
7235
- template: "\n <banta-chat-message \n *ngIf=\"message\"\n [message]=\"message\"\n (upvoted)=\"upvote()\"\n (reported)=\"report()\"\n (selected)=\"select()\"\n ></banta-chat-message>\n ",
7236
- styles: [""]
7237
- }),
7238
- __metadata("design:paramtypes", [ChatBackendService])
7239
- ], LiveChatMessageComponent);
7240
7551
  return LiveChatMessageComponent;
7241
- }());
7552
+ }());
7553
+ LiveChatMessageComponent.decorators = [
7554
+ { type: core.Component, args: [{
7555
+ selector: 'banta-live-chat-message',
7556
+ template: "\n <banta-chat-message \n *ngIf=\"message\"\n [message]=\"message\"\n (upvoted)=\"upvote()\"\n (reported)=\"report()\"\n (selected)=\"select()\"\n ></banta-chat-message>\n ",
7557
+ styles: [""]
7558
+ },] }
7559
+ ];
7560
+ LiveChatMessageComponent.ctorParameters = function () { return [
7561
+ { type: ChatBackendService }
7562
+ ]; };
7563
+ LiveChatMessageComponent.propDecorators = {
7564
+ upvoted: [{ type: core.Output }],
7565
+ reported: [{ type: core.Output }],
7566
+ selected: [{ type: core.Output }],
7567
+ message: [{ type: core.Input }]
7568
+ };
7242
7569
 
7243
7570
  var ChatViewComponent = /** @class */ (function () {
7244
7571
  function ChatViewComponent(elementRef) {
@@ -7279,35 +7606,35 @@
7279
7606
  }
7280
7607
  }
7281
7608
  },
7282
- enumerable: true,
7609
+ enumerable: false,
7283
7610
  configurable: true
7284
7611
  });
7285
7612
  Object.defineProperty(ChatViewComponent.prototype, "selected", {
7286
7613
  get: function () {
7287
7614
  return this._selected;
7288
7615
  },
7289
- enumerable: true,
7616
+ enumerable: false,
7290
7617
  configurable: true
7291
7618
  });
7292
7619
  Object.defineProperty(ChatViewComponent.prototype, "userSelected", {
7293
7620
  get: function () {
7294
7621
  return this._userSelected;
7295
7622
  },
7296
- enumerable: true,
7623
+ enumerable: false,
7297
7624
  configurable: true
7298
7625
  });
7299
7626
  Object.defineProperty(ChatViewComponent.prototype, "reported", {
7300
7627
  get: function () {
7301
7628
  return this._reported;
7302
7629
  },
7303
- enumerable: true,
7630
+ enumerable: false,
7304
7631
  configurable: true
7305
7632
  });
7306
7633
  Object.defineProperty(ChatViewComponent.prototype, "upvoted", {
7307
7634
  get: function () {
7308
7635
  return this._upvoted;
7309
7636
  },
7310
- enumerable: true,
7637
+ enumerable: false,
7311
7638
  configurable: true
7312
7639
  });
7313
7640
  ChatViewComponent.prototype.addMessage = function (message) {
@@ -7386,52 +7713,27 @@
7386
7713
  }
7387
7714
  return null;
7388
7715
  };
7389
- ChatViewComponent.ctorParameters = function () { return [
7390
- { type: core.ElementRef }
7391
- ]; };
7392
- __decorate([
7393
- core.Input(),
7394
- __metadata("design:type", Object),
7395
- __metadata("design:paramtypes", [Object])
7396
- ], ChatViewComponent.prototype, "source", null);
7397
- __decorate([
7398
- core.Output(),
7399
- __metadata("design:type", Object),
7400
- __metadata("design:paramtypes", [])
7401
- ], ChatViewComponent.prototype, "selected", null);
7402
- __decorate([
7403
- core.Output(),
7404
- __metadata("design:type", Object),
7405
- __metadata("design:paramtypes", [])
7406
- ], ChatViewComponent.prototype, "userSelected", null);
7407
- __decorate([
7408
- core.Output(),
7409
- __metadata("design:type", Object),
7410
- __metadata("design:paramtypes", [])
7411
- ], ChatViewComponent.prototype, "reported", null);
7412
- __decorate([
7413
- core.Output(),
7414
- __metadata("design:type", Object),
7415
- __metadata("design:paramtypes", [])
7416
- ], ChatViewComponent.prototype, "upvoted", null);
7417
- __decorate([
7418
- core.ViewChild('messageContainer'),
7419
- __metadata("design:type", core.ElementRef)
7420
- ], ChatViewComponent.prototype, "messageContainer", void 0);
7421
- __decorate([
7422
- core.Input(),
7423
- __metadata("design:type", Number)
7424
- ], ChatViewComponent.prototype, "maxMessages", void 0);
7425
- ChatViewComponent = __decorate([
7426
- core.Component({
7427
- selector: 'banta-chat-view',
7428
- template: "<div class=\"message-container\" #messageContainer>\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <banta-chat-message \r\n *ngFor=\"let message of messages\"\r\n [message]=\"message\"\r\n [class.highlight]=\"mentionsMe(message)\" \r\n [class.flash]=\"message.id === flashedMessageId\"\r\n (selected)=\"selectMessage(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (userSelected)=\"selectMessageUser(message)\"\r\n [attr.data-id]=\"message.id\"\r\n >\r\n </banta-chat-message>\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>",
7429
- styles: [":host{display:flex;flex-direction:column;flex-grow:1}.message-container{flex-grow:1;overflow-y:auto;overflow-x:hidden;height:10em;color:#000;background:#fff;padding:.5em 1em .5em .5em}.message-container.no-scroll{height:auto;overflow-y:visible}:host-context(.mat-dark-theme) .message-container{color:#fff;background:#000}banta-chat-message.flash{-webkit-animation:2.5s flash;animation:2.5s flash}@-webkit-keyframes flash{0%{transform:scale(1);background:#425700}25%,75%{transform:scale(1.05)}100%,50%{transform:scale(1)}}@keyframes flash{0%{transform:scale(1);background:#425700}25%,75%{transform:scale(1.05)}100%,50%{transform:scale(1)}}"]
7430
- }),
7431
- __metadata("design:paramtypes", [core.ElementRef])
7432
- ], ChatViewComponent);
7433
7716
  return ChatViewComponent;
7434
- }());
7717
+ }());
7718
+ ChatViewComponent.decorators = [
7719
+ { type: core.Component, args: [{
7720
+ selector: 'banta-chat-view',
7721
+ template: "<div class=\"message-container\" #messageContainer>\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <banta-chat-message \r\n *ngFor=\"let message of messages\"\r\n [message]=\"message\"\r\n [class.highlight]=\"mentionsMe(message)\" \r\n [class.flash]=\"message.id === flashedMessageId\"\r\n (selected)=\"selectMessage(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (userSelected)=\"selectMessageUser(message)\"\r\n [attr.data-id]=\"message.id\"\r\n >\r\n </banta-chat-message>\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>",
7722
+ styles: [":host{display:flex;flex-direction:column;flex-grow:1}.message-container{background:#fff;color:#000;flex-grow:1;height:10em;overflow-x:hidden;overflow-y:auto;padding:.5em 1em .5em .5em}.message-container.no-scroll{height:auto;overflow-y:visible}:host-context(.mat-dark-theme) .message-container{background:#000;color:#fff}banta-chat-message.flash{-webkit-animation:flash;-webkit-animation-duration:2.5s;-webkit-animation-iteration-count:1;animation:flash;animation-duration:2.5s;animation-iteration-count:1}@-webkit-keyframes flash{0%{background:#425700;transform:scale(1)}25%{transform:scale(1.05)}50%{transform:scale(1)}75%{transform:scale(1.05)}to{transform:scale(1)}}@keyframes flash{0%{background:#425700;transform:scale(1)}25%{transform:scale(1.05)}50%{transform:scale(1)}75%{transform:scale(1.05)}to{transform:scale(1)}}"]
7723
+ },] }
7724
+ ];
7725
+ ChatViewComponent.ctorParameters = function () { return [
7726
+ { type: core.ElementRef }
7727
+ ]; };
7728
+ ChatViewComponent.propDecorators = {
7729
+ source: [{ type: core.Input }],
7730
+ selected: [{ type: core.Output }],
7731
+ userSelected: [{ type: core.Output }],
7732
+ reported: [{ type: core.Output }],
7733
+ upvoted: [{ type: core.Output }],
7734
+ messageContainer: [{ type: core.ViewChild, args: ['messageContainer',] }],
7735
+ maxMessages: [{ type: core.Input }]
7736
+ };
7435
7737
 
7436
7738
  /**
7437
7739
  * Chat component
@@ -7469,7 +7771,7 @@
7469
7771
  set: function (value) {
7470
7772
  this._source = value;
7471
7773
  },
7472
- enumerable: true,
7774
+ enumerable: false,
7473
7775
  configurable: true
7474
7776
  });
7475
7777
  Object.defineProperty(BantaChatComponent.prototype, "topicID", {
@@ -7479,517 +7781,196 @@
7479
7781
  set: function (value) {
7480
7782
  this.setSourceFromTopicID(value);
7481
7783
  },
7482
- enumerable: true,
7784
+ enumerable: false,
7483
7785
  configurable: true
7484
7786
  });
7485
7787
  BantaChatComponent.prototype.setSourceFromTopicID = function (topicID) {
7486
7788
  return __awaiter(this, void 0, void 0, function () {
7487
- var _a;
7488
- return __generator(this, function (_b) {
7489
- switch (_b.label) {
7490
- case 0:
7491
- if (this._source && this._source.close)
7492
- this._source.close();
7493
- this._source = null;
7494
- _a = this;
7495
- return [4 /*yield*/, this.backend.getSourceForTopic(topicID)];
7496
- case 1:
7497
- _a._source = _b.sent();
7498
- return [2 /*return*/];
7499
- }
7500
- });
7501
- });
7502
- };
7503
- Object.defineProperty(BantaChatComponent.prototype, "signInSelected", {
7504
- get: function () {
7505
- return this._signInSelected;
7506
- },
7507
- enumerable: true,
7508
- configurable: true
7509
- });
7510
- Object.defineProperty(BantaChatComponent.prototype, "permissionDeniedError", {
7511
- get: function () {
7512
- return this._permissionDeniedError;
7513
- },
7514
- enumerable: true,
7515
- configurable: true
7516
- });
7517
- BantaChatComponent.prototype.showSignIn = function () {
7518
- this._signInSelected.next();
7519
- };
7520
- BantaChatComponent.prototype.sendPermissionError = function () {
7521
- this._permissionDeniedError.next();
7522
- };
7523
- BantaChatComponent.prototype.insertEmoji = function (emoji) {
7524
- var message = this.newMessage.message || '';
7525
- this.newMessage.message = message + emoji;
7526
- };
7527
- BantaChatComponent.prototype.onKeyDown = function (event) {
7528
- // TODO
7529
- };
7530
- BantaChatComponent.prototype.jumpToMessage = function (message) {
7531
- if (this.chatView)
7532
- this.chatView.jumpTo(message);
7533
- };
7534
- BantaChatComponent.prototype.select = function (message) {
7535
- this._selected.next(message);
7536
- };
7537
- BantaChatComponent.prototype.selectUser = function (message) {
7538
- this._userSelected.next(message);
7539
- };
7540
- BantaChatComponent.prototype.report = function (message) {
7541
- this._reported.next(message);
7542
- };
7543
- BantaChatComponent.prototype.upvote = function (message) {
7544
- this._upvoted.next(message);
7545
- };
7546
- Object.defineProperty(BantaChatComponent.prototype, "selected", {
7547
- get: function () {
7548
- return this._selected;
7549
- },
7550
- enumerable: true,
7551
- configurable: true
7552
- });
7553
- Object.defineProperty(BantaChatComponent.prototype, "reported", {
7554
- get: function () {
7555
- return this._reported;
7556
- },
7557
- enumerable: true,
7558
- configurable: true
7559
- });
7560
- Object.defineProperty(BantaChatComponent.prototype, "upvoted", {
7561
- get: function () {
7562
- return this._upvoted;
7563
- },
7564
- enumerable: true,
7565
- configurable: true
7566
- });
7567
- Object.defineProperty(BantaChatComponent.prototype, "userSelected", {
7568
- get: function () {
7569
- return this._userSelected;
7570
- },
7571
- enumerable: true,
7572
- configurable: true
7573
- });
7574
- Object.defineProperty(BantaChatComponent.prototype, "canChat", {
7575
- get: function () {
7576
- var _a;
7577
- if (!this.user.permissions)
7578
- return true;
7579
- return (_a = this.user.permissions) === null || _a === void 0 ? void 0 : _a.canChat(this.source);
7580
- },
7581
- enumerable: true,
7582
- configurable: true
7583
- });
7584
- BantaChatComponent.prototype.sendMessage = function () {
7585
- if (!this.source)
7586
- return;
7587
- var text = (this.newMessage.message || '').trim();
7588
- this.newMessage.message = '';
7589
- if (text === '')
7590
- return;
7591
- var message = {
7592
- user: null,
7593
- sentAt: Date.now(),
7594
- upvotes: 0,
7595
- message: text
7596
- };
7597
- this.source.send(message);
7598
- };
7599
- BantaChatComponent.ctorParameters = function () { return [
7600
- { type: BantaService },
7601
- { type: ChatBackendService },
7602
- { type: core.ElementRef }
7603
- ]; };
7604
- __decorate([
7605
- core.Input(),
7606
- __metadata("design:type", Object),
7607
- __metadata("design:paramtypes", [Object])
7608
- ], BantaChatComponent.prototype, "source", null);
7609
- __decorate([
7610
- core.Input(),
7611
- __metadata("design:type", String),
7612
- __metadata("design:paramtypes", [Object])
7613
- ], BantaChatComponent.prototype, "topicID", null);
7614
- __decorate([
7615
- core.Input(),
7616
- __metadata("design:type", Object)
7617
- ], BantaChatComponent.prototype, "signInLabel", void 0);
7618
- __decorate([
7619
- core.Input(),
7620
- __metadata("design:type", Object)
7621
- ], BantaChatComponent.prototype, "sendLabel", void 0);
7622
- __decorate([
7623
- core.Input(),
7624
- __metadata("design:type", Object)
7625
- ], BantaChatComponent.prototype, "permissionDeniedLabel", void 0);
7626
- __decorate([
7627
- core.Output(),
7628
- __metadata("design:type", rxjs.Observable),
7629
- __metadata("design:paramtypes", [])
7630
- ], BantaChatComponent.prototype, "signInSelected", null);
7631
- __decorate([
7632
- core.Output(),
7633
- __metadata("design:type", rxjs.Observable),
7634
- __metadata("design:paramtypes", [])
7635
- ], BantaChatComponent.prototype, "permissionDeniedError", null);
7636
- __decorate([
7637
- core.ViewChild('chatView', { static: true }),
7638
- __metadata("design:type", ChatViewComponent)
7639
- ], BantaChatComponent.prototype, "chatView", void 0);
7640
- __decorate([
7641
- core.Output(),
7642
- __metadata("design:type", Object),
7643
- __metadata("design:paramtypes", [])
7644
- ], BantaChatComponent.prototype, "selected", null);
7645
- __decorate([
7646
- core.Output(),
7647
- __metadata("design:type", Object),
7648
- __metadata("design:paramtypes", [])
7649
- ], BantaChatComponent.prototype, "reported", null);
7650
- __decorate([
7651
- core.Output(),
7652
- __metadata("design:type", Object),
7653
- __metadata("design:paramtypes", [])
7654
- ], BantaChatComponent.prototype, "upvoted", null);
7655
- __decorate([
7656
- core.Output(),
7657
- __metadata("design:type", Object),
7658
- __metadata("design:paramtypes", [])
7659
- ], BantaChatComponent.prototype, "userSelected", null);
7660
- BantaChatComponent = __decorate([
7661
- core.Component({
7662
- selector: 'banta-chat',
7663
- template: "<banta-chat-view \r\n #chatView\r\n [source]=\"source\"\r\n (upvoted)=\"upvote($event)\"\r\n (reported)=\"report($event)\"\r\n (selected)=\"select($event)\"\r\n (userSelected)=\"selectUser($event)\"\r\n ></banta-chat-view>\r\n\r\n<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n \r\n <div class=\"entry-container\">\r\n <input\r\n type=\"text\"\r\n name=\"message\" \r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessage.message\" />\r\n \r\n <emoji-selector-button\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n\r\n <ng-container *ngIf=\"!user\">\r\n <button type=\"button\" (click)=\"showSignIn()\" mat-raised-button color=\"primary\">{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button *ngIf=\"canChat\" [disabled]=\"!newMessage.message\" mat-raised-button color=\"primary\">{{sendLabel}}</button>\r\n <button *ngIf=\"!canChat\" type=\"button\" (click)=\"sendPermissionError()\" mat-raised-button color=\"primary\">{{permissionDeniedLabel}}</button>\r\n </ng-container>\r\n </div>\r\n</form>",
7664
- styles: [":host{display:flex;flex-direction:column;border-radius:5px;padding:10px;flex-grow:1;font-size:10pt}.entry-container{display:flex;flex-direction:row;flex-grow:1;position:relative}.entry-container emoji-selector-button{position:absolute;right:0;top:.15em}.entry-container input{height:2.6em;font-size:12pt;padding-left:1em}.entry-container input:-webkit-autofill,.entry-container input:-webkit-autofill:focus,.entry-container input:-webkit-autofill:hover{outline:#9da302 solid 1px;-webkit-text-fill-color:#9da302;-webkit-box-shadow:0 0 0 1000px #211e07 inset;-webkit-transition:background-color 5000s ease-in-out;transition:background-color 5000s ease-in-out;caret-color:#9da302}.entry-container emoji-selector-panel{pointer-events:none;opacity:0;position:absolute;bottom:3.5em;right:0}.entry-container emoji-selector-panel.visible{opacity:1;pointer-events:initial}form{display:flex;padding:.5em 0;align-items:center}form textarea{font-size:14pt;background:#000;color:#fff;border:1px solid #333;min-height:6em;width:100%}form input[type=text]{background:#fff;color:#000;border:1px solid #ccc;width:100%;height:2.5em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}:host-context(.mat-dark-theme) form input[type=text]{background:#000;color:#fff;border:1px solid #333}"]
7665
- }),
7666
- __metadata("design:paramtypes", [BantaService,
7667
- ChatBackendService,
7668
- core.ElementRef])
7669
- ], BantaChatComponent);
7670
- return BantaChatComponent;
7671
- }());
7672
-
7673
- var COMPONENTS$2 = [
7674
- ChatMessageComponent,
7675
- LiveChatMessageComponent,
7676
- ChatViewComponent,
7677
- BantaChatComponent
7678
- ];
7679
- var ChatModule = /** @class */ (function () {
7680
- function ChatModule() {
7681
- }
7682
- ChatModule = __decorate([
7683
- core.NgModule({
7684
- declarations: COMPONENTS$2,
7685
- imports: [
7686
- common.CommonModule,
7687
- forms.FormsModule,
7688
- icon.MatIconModule,
7689
- button.MatButtonModule,
7690
- EmojiModule
7691
- ],
7692
- exports: COMPONENTS$2
7693
- })
7694
- ], ChatModule);
7695
- return ChatModule;
7696
- }());
7697
-
7698
- /**
7699
- * Unified chat and comments component
7700
- */
7701
- var BantaComponent = /** @class */ (function () {
7702
- function BantaComponent(banta, backend, matDialog) {
7703
- this.banta = banta;
7704
- this.backend = backend;
7705
- this.matDialog = matDialog;
7706
- this._subs = new subsink.SubSink();
7707
- this.auxOpen = false;
7708
- this.auxTitle = 'Notifications';
7709
- this.auxMode = 'notifications';
7710
- this.mobileFocus = null;
7711
- this.newNotifications = false;
7712
- this.chatLabel = 'Chat';
7713
- this.commentsLabel = 'Comments';
7714
- this._signInSelected = new rxjs.Subject();
7715
- this.pointOpen = null;
7716
- this.pointSubChat = null;
7717
- this.newPointSubMessage = {};
7718
- this.genericAvatarUrl = 'https://gravatar.com/avatar/915c804e0be607a4ad766ddadea5c48a?s=512&d=https://codepen.io/assets/avatars/user-avatar-512x512-6e240cf350d2f1cc07c2bed234c3a3bb5f1b237023c204c782622e80d6b212ba.png';
7719
- // this.firehoseSource = new MockFirehoseSource();
7720
- // this.pointSource = new MockPointSource();
7721
- }
7722
- BantaComponent.prototype.ngOnInit = function () {
7723
- var _this = this;
7724
- this._subs.add(this.banta.userChanged.subscribe(function (user) { return _this.currentUser = user; }), this.backend.notificationsChanged.subscribe(function (notifs) { return _this.notifications = notifs; }), this.backend.newNotification.subscribe(function (notif) {
7725
- _this.newNotifications = true;
7726
- }));
7727
- };
7728
- BantaComponent.prototype.newPointSubMessageKeyDown = function (event) {
7729
- // TODO
7730
- };
7731
- BantaComponent.prototype.sendPointSubMessage = function () {
7732
- return __awaiter(this, void 0, void 0, function () {
7733
- var text, message, e_1;
7734
- return __generator(this, function (_a) {
7735
- switch (_a.label) {
7736
- case 0:
7737
- text = (this.newPointSubMessage.message || '').trim();
7738
- this.newPointSubMessage.message = '';
7739
- if (text === '')
7740
- return [2 /*return*/];
7741
- message = {
7742
- user: null,
7743
- sentAt: Date.now(),
7744
- upvotes: 0,
7745
- message: text
7746
- };
7747
- _a.label = 1;
7748
- case 1:
7749
- _a.trys.push([1, 3, , 4]);
7750
- return [4 /*yield*/, this.pointSubChat.send(message)];
7751
- case 2:
7752
- _a.sent();
7753
- return [3 /*break*/, 4];
7754
- case 3:
7755
- e_1 = _a.sent();
7756
- console.error("Failed to send point sub-message:");
7757
- console.error(e_1);
7758
- return [3 /*break*/, 4];
7759
- case 4: return [2 /*return*/];
7760
- }
7761
- });
7762
- });
7763
- };
7764
- BantaComponent.prototype.goToMessage = function (message) {
7765
- return __awaiter(this, void 0, void 0, function () {
7766
- var targetMessage, parentMessage, viewType, _a, _b;
7789
+ var _b;
7767
7790
  return __generator(this, function (_c) {
7768
7791
  switch (_c.label) {
7769
7792
  case 0:
7770
- targetMessage = message;
7771
- if (!message.parentMessageId) return [3 /*break*/, 2];
7772
- return [4 /*yield*/, this.backend.getMessage(message.topicId, message.parentMessageId)];
7773
- case 1:
7774
- parentMessage = _c.sent();
7775
- if (!parentMessage) {
7776
- console.error("Failed to look up parent message " + message.topicId + "/" + message.parentMessageId);
7777
- console.error("Original message was:");
7778
- console.dir(targetMessage);
7779
- return [2 /*return*/];
7780
- }
7781
- message = parentMessage;
7782
- _c.label = 2;
7783
- case 2:
7784
- viewType = this.getViewType(message);
7785
- if (!(viewType === 'comment')) return [3 /*break*/, 5];
7786
- if (this.pointSubChat) {
7787
- if (this.pointSubChat.close)
7788
- this.pointSubChat.close();
7789
- this.pointSubChat = null;
7790
- }
7791
- this.mobileFocus = 'points';
7792
- this.pointOpen = message;
7793
- _a = this;
7794
- return [4 /*yield*/, this.backend.getSourceForThread(message.topicId, message.id)];
7795
- case 3:
7796
- _a.pointSubChat = _c.sent();
7797
- _b = this;
7798
- return [4 /*yield*/, this.backend.refreshMessage(message)];
7799
- case 4:
7800
- _b.pointOpen = _c.sent();
7801
- this.newPointSubMessage = {};
7802
- return [3 /*break*/, 6];
7803
- case 5:
7804
- if (viewType === 'chat') {
7805
- this.mobileFocus = 'firehose';
7806
- this.firehose.jumpToMessage(message);
7807
- }
7808
- _c.label = 6;
7809
- case 6: return [2 /*return*/];
7810
- }
7811
- });
7812
- });
7813
- };
7814
- BantaComponent.prototype.pointUnfocus = function () {
7815
- this.pointOpen = null;
7816
- if (this.pointSubChat) {
7817
- if (this.pointSubChat.close)
7818
- this.pointSubChat.close();
7819
- this.pointSubChat = null;
7820
- }
7821
- };
7822
- BantaComponent.prototype.ngOnDestroy = function () {
7823
- this._subs.unsubscribe();
7824
- };
7825
- BantaComponent.prototype.showAux = function (title, mode) {
7826
- this.auxOpen = true;
7827
- this.auxTitle = title;
7828
- this.auxMode = mode;
7829
- this.mobileFocus = 'aux';
7830
- };
7831
- BantaComponent.prototype.showNotifications = function () {
7832
- this.showAux('Notifications', 'notifications');
7833
- };
7834
- Object.defineProperty(BantaComponent.prototype, "topicID", {
7835
- get: function () {
7836
- return this._topicID;
7837
- },
7838
- set: function (value) {
7839
- this._topicID = value;
7840
- this.close();
7841
- this.connectToTopic(this._topicID);
7842
- },
7843
- enumerable: true,
7844
- configurable: true
7845
- });
7846
- BantaComponent.prototype.connectToTopic = function (id) {
7847
- return __awaiter(this, void 0, void 0, function () {
7848
- var _a, _b;
7849
- return __generator(this, function (_c) {
7850
- switch (_c.label) {
7851
- case 0:
7852
- _a = this;
7853
- return [4 /*yield*/, this.backend.getSourceForTopic(id + "_firehose")];
7854
- case 1:
7855
- _a.firehoseSource = _c.sent();
7856
- _b = this;
7857
- return [4 /*yield*/, this.backend.getSourceForTopic(id + "_thepoint")];
7858
- case 2:
7859
- _b.pointSource = _c.sent();
7793
+ if (this._source && this._source.close)
7794
+ this._source.close();
7795
+ this._source = null;
7796
+ _b = this;
7797
+ return [4 /*yield*/, this.backend.getSourceForTopic(topicID)];
7798
+ case 1:
7799
+ _b._source = _c.sent();
7860
7800
  return [2 /*return*/];
7861
7801
  }
7862
7802
  });
7863
7803
  });
7864
7804
  };
7865
- Object.defineProperty(BantaComponent.prototype, "signInSelected", {
7805
+ Object.defineProperty(BantaChatComponent.prototype, "signInSelected", {
7866
7806
  get: function () {
7867
7807
  return this._signInSelected;
7868
7808
  },
7869
- enumerable: true,
7809
+ enumerable: false,
7870
7810
  configurable: true
7871
7811
  });
7872
- BantaComponent.prototype.showSignIn = function () {
7812
+ Object.defineProperty(BantaChatComponent.prototype, "permissionDeniedError", {
7813
+ get: function () {
7814
+ return this._permissionDeniedError;
7815
+ },
7816
+ enumerable: false,
7817
+ configurable: true
7818
+ });
7819
+ BantaChatComponent.prototype.showSignIn = function () {
7873
7820
  this._signInSelected.next();
7874
7821
  };
7875
- BantaComponent.prototype.close = function () {
7876
- if (this.firehoseSource) {
7877
- if (this.firehoseSource.close)
7878
- this.firehoseSource.close();
7879
- this.firehoseSource = null;
7880
- }
7881
- if (this.pointSource) {
7882
- if (this.pointSource.close)
7883
- this.pointSource.close();
7884
- this.pointSource = null;
7885
- }
7822
+ BantaChatComponent.prototype.sendPermissionError = function () {
7823
+ this._permissionDeniedError.next();
7886
7824
  };
7887
- Object.defineProperty(BantaComponent.prototype, "hasPoint", {
7825
+ BantaChatComponent.prototype.insertEmoji = function (emoji) {
7826
+ var message = this.newMessage.message || '';
7827
+ this.newMessage.message = message + emoji;
7828
+ };
7829
+ BantaChatComponent.prototype.onKeyDown = function (event) {
7830
+ // TODO
7831
+ };
7832
+ BantaChatComponent.prototype.jumpToMessage = function (message) {
7833
+ if (this.chatView)
7834
+ this.chatView.jumpTo(message);
7835
+ };
7836
+ BantaChatComponent.prototype.select = function (message) {
7837
+ this._selected.next(message);
7838
+ };
7839
+ BantaChatComponent.prototype.selectUser = function (message) {
7840
+ this._userSelected.next(message);
7841
+ };
7842
+ BantaChatComponent.prototype.report = function (message) {
7843
+ this._reported.next(message);
7844
+ };
7845
+ BantaChatComponent.prototype.upvote = function (message) {
7846
+ this._upvoted.next(message);
7847
+ };
7848
+ Object.defineProperty(BantaChatComponent.prototype, "selected", {
7888
7849
  get: function () {
7889
- return this.pointOpen != null;
7850
+ return this._selected;
7890
7851
  },
7891
- enumerable: true,
7852
+ enumerable: false,
7892
7853
  configurable: true
7893
7854
  });
7894
- BantaComponent.prototype.closeAux = function () {
7895
- this.auxOpen = false;
7896
- this.mobileFocus = 'firehose';
7897
- };
7898
- BantaComponent.prototype.getViewType = function (message) {
7899
- if (message.topicId.endsWith('_firehose'))
7900
- return 'chat';
7901
- else if (message.topicId.endsWith('_thepoint'))
7902
- return 'comment';
7903
- return 'comment';
7904
- };
7905
- BantaComponent.prototype.upvoteMessage = function (message) {
7855
+ Object.defineProperty(BantaChatComponent.prototype, "reported", {
7856
+ get: function () {
7857
+ return this._reported;
7858
+ },
7859
+ enumerable: false,
7860
+ configurable: true
7861
+ });
7862
+ Object.defineProperty(BantaChatComponent.prototype, "upvoted", {
7863
+ get: function () {
7864
+ return this._upvoted;
7865
+ },
7866
+ enumerable: false,
7867
+ configurable: true
7868
+ });
7869
+ Object.defineProperty(BantaChatComponent.prototype, "userSelected", {
7870
+ get: function () {
7871
+ return this._userSelected;
7872
+ },
7873
+ enumerable: false,
7874
+ configurable: true
7875
+ });
7876
+ Object.defineProperty(BantaChatComponent.prototype, "canChat", {
7877
+ get: function () {
7878
+ var _a;
7879
+ if (!this.user.permissions)
7880
+ return true;
7881
+ return (_a = this.user.permissions) === null || _a === void 0 ? void 0 : _a.canChat(this.source);
7882
+ },
7883
+ enumerable: false,
7884
+ configurable: true
7885
+ });
7886
+ BantaChatComponent.prototype.sendMessage = function () {
7906
7887
  return __awaiter(this, void 0, void 0, function () {
7907
- return __generator(this, function (_a) {
7908
- switch (_a.label) {
7888
+ var text, message, e_1;
7889
+ return __generator(this, function (_b) {
7890
+ switch (_b.label) {
7909
7891
  case 0:
7910
- if (!message.parentMessageId) return [3 /*break*/, 2];
7911
- return [4 /*yield*/, this.backend.upvoteMessage(message.topicId, message.parentMessageId, message.id)];
7892
+ if (!this.source)
7893
+ return [2 /*return*/];
7894
+ text = (this.newMessage.message || '').trim();
7895
+ this.newMessage.message = '';
7896
+ if (text === '')
7897
+ return [2 /*return*/];
7898
+ message = {
7899
+ user: null,
7900
+ sentAt: Date.now(),
7901
+ upvotes: 0,
7902
+ message: text
7903
+ };
7904
+ _b.label = 1;
7912
7905
  case 1:
7913
- _a.sent();
7906
+ _b.trys.push([1, 3, , 4]);
7907
+ return [4 /*yield*/, this.source.send(message)];
7908
+ case 2:
7909
+ _b.sent();
7914
7910
  return [3 /*break*/, 4];
7915
- case 2: return [4 /*yield*/, this.backend.upvoteMessage(message.topicId, message.id)];
7916
7911
  case 3:
7917
- _a.sent();
7918
- _a.label = 4;
7912
+ e_1 = _b.sent();
7913
+ console.error("Failed to send message: ", message);
7914
+ console.error(e_1);
7915
+ return [3 /*break*/, 4];
7919
7916
  case 4: return [2 /*return*/];
7920
7917
  }
7921
7918
  });
7922
7919
  });
7923
7920
  };
7924
- BantaComponent.prototype.showProfile = function (user) {
7925
- this.profileUser = user;
7926
- this.showAux("@" + user.username + "'s Profile", 'profile');
7927
- };
7928
- BantaComponent.prototype.sendReport = function (message) {
7929
- this.auxOpen = false;
7930
- alert('would send report');
7931
- };
7932
- BantaComponent.prototype.reportMessage = function (message) {
7933
- this.reportedMessage = message;
7934
- this.showAux("Report message from @" + message.user.username, 'report');
7935
- };
7936
- BantaComponent.ctorParameters = function () { return [
7937
- { type: BantaService },
7938
- { type: ChatBackendService },
7939
- { type: dialog.MatDialog }
7940
- ]; };
7941
- __decorate([
7942
- core.ViewChild('firehose', { static: true }),
7943
- __metadata("design:type", BantaChatComponent)
7944
- ], BantaComponent.prototype, "firehose", void 0);
7945
- __decorate([
7946
- core.Input(),
7947
- __metadata("design:type", String),
7948
- __metadata("design:paramtypes", [Object])
7949
- ], BantaComponent.prototype, "topicID", null);
7950
- __decorate([
7951
- core.Input(),
7952
- __metadata("design:type", Object)
7953
- ], BantaComponent.prototype, "chatLabel", void 0);
7954
- __decorate([
7955
- core.Input(),
7956
- __metadata("design:type", Object)
7957
- ], BantaComponent.prototype, "commentsLabel", void 0);
7958
- __decorate([
7959
- core.Output(),
7960
- __metadata("design:type", rxjs.Observable),
7961
- __metadata("design:paramtypes", [])
7962
- ], BantaComponent.prototype, "signInSelected", null);
7963
- __decorate([
7964
- core.HostBinding('class.point-focus'),
7965
- __metadata("design:type", Object),
7966
- __metadata("design:paramtypes", [])
7967
- ], BantaComponent.prototype, "hasPoint", null);
7968
- BantaComponent = __decorate([
7969
- core.Component({
7970
- selector: "banta",
7971
- template: "\r\n<mat-menu #userMenu=\"matMenu\">\r\n <ng-container *ngIf=\"currentUser\">\r\n <button [disabled]=\"true\" mat-menu-item>{{currentUser.displayName}} (@{{currentUser.username}})</button>\r\n <button mat-menu-item (click)=\"signOut()\">Sign Out</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"!currentUser\">\r\n <button mat-menu-item>Sign In</button>\r\n </ng-container>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"tabs\">\r\n <div>\r\n <a mat-button (click)=\"mobileFocus = 'chat'\">{{chatLabel}}</a>\r\n <a mat-button (click)=\"mobileFocus = 'comments'\">{{commentsLabel}}</a>\r\n </div>\r\n <div class=\"spacer\"></div>\r\n <div>\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n</div>\r\n\r\n<div class=\"firehose\" [class.focus]=\"mobileFocus === 'chat'\">\r\n <header>\r\n <div>\r\n <label (click)=\"mobileFocus = 'chat'\">{{chatLabel}}</label>\r\n <div class=\"spacer\"></div>\r\n\r\n <ng-container *ngIf=\"currentUser\">\r\n <button mat-button [matMenuTriggerFor]=\"userMenu\">\r\n @{{currentUser.username}}\r\n </button>\r\n <button mat-icon-button (click)=\"showNotifications()\">\r\n <mat-icon>notification_important</mat-icon>\r\n </button>\r\n </ng-container>\r\n \r\n <button mat-button *ngIf=\"!currentUser\" (click)=\"showSignIn()\">\r\n Sign In\r\n </button>\r\n </div>\r\n </header>\r\n <banta-chat \r\n #firehose\r\n [source]=\"firehoseSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></banta-chat>\r\n</div>\r\n\r\n<div class=\"aux\" [class.focus]=\"mobileFocus === 'aux'\" [class.open]=\"auxOpen\">\r\n <header>\r\n <div>\r\n <label>{{auxTitle}}</label>\r\n <div class=\"spacer\"></div>\r\n <button mat-icon-button (click)=\"auxOpen = false\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n </header>\r\n <div class=\"aux-contents\">\r\n <ng-container *ngIf=\"auxMode === 'profile'\">\r\n <ng-container *ngIf=\"profileUser\">\r\n\r\n <div>\r\n <strong style=\"font-size: 125%;\">\r\n {{profileUser.displayName}}\r\n </strong>\r\n @{{profileUser.username}}\r\n </div>\r\n\r\n <br/>\r\n <strong>Top Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <br/>\r\n <strong>Recent Messages</strong>\r\n\r\n <div>\r\n <em>Not yet available</em>\r\n </div>\r\n\r\n <pre>{{profileUser | json}}</pre>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'report'\">\r\n <p>Are you sure you want to report this message?</p>\r\n\r\n <banta-live-message [message]=\"reportedMessage\"></banta-live-message>\r\n\r\n <div style=\"text-align: center;\">\r\n <button mat-raised-button color=\"primary\" (click)=\"sendReport(reportedMessage)\">Yes, Report</button>\r\n &nbsp;\r\n <button mat-raised-button color=\"secondary\" (click)=\"auxOpen = false\">No, Cancel</button>\r\n </div>\r\n\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"auxMode === 'notifications'\">\r\n\r\n <div *ngIf=\"!notifications || notifications.length === 0\">\r\n <em>You do not have any notifications yet</em>\r\n </div>\r\n \r\n <div class=\"notifications\">\r\n <div class=\"notification\" *ngFor=\"let notif of notifications\">\r\n <div>\r\n <ng-container *ngIf=\"notif.type === 'upvote'\">\r\n @{{notif.message?.user?.username}} upvoted your post\r\n \r\n <banta-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </banta-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'notice'\">\r\n <div>\r\n {{notif.message}}\r\n </div>\r\n <a mat-button target=\"_blank\" href=\"{{notif.actionUrl}}\">\r\n {{notif.actionLabel}}\r\n </a>\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'mention'\">\r\n You were mentioned by @{{notif.message?.user?.username}}\r\n\r\n <banta-live-message\r\n [message]=\"notif.message\"\r\n (upvoted)=\"upvoteMessage(notif.message)\"\r\n (reported)=\"reportMessage(notif.message)\"\r\n (selected)=\"goToMessage(notif.message)\">\r\n </banta-live-message>\r\n\r\n </ng-container>\r\n <ng-container *ngIf=\"notif.type === 'reply'\">\r\n @{{notif.replyMessage?.user?.username}} replied to your post\r\n \r\n <banta-live-message\r\n [message]=\"notif.replyMessage\"\r\n (upvoted)=\"upvoteMessage(notif.replyMessage)\"\r\n (reported)=\"reportMessage(notif.replyMessage)\"\r\n (selected)=\"goToMessage(notif.replyMessage)\">\r\n </banta-live-message>\r\n </ng-container>\r\n </div>\r\n\r\n <banta-timestamp [value]=\"notif.sentAt\"></banta-timestamp>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n</div>\r\n<div class=\"points\" [class.focus]=\"mobileFocus === 'points'\">\r\n <header>\r\n <div>\r\n <label>{{commentsLabel}}</label>\r\n </div>\r\n </header>\r\n <div class=\"point-focus\">\r\n <div class=\"actions\">\r\n <button mat-button (click)=\"pointUnfocus()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Back\r\n </button>\r\n\r\n <div class=\"spacer\"></div>\r\n \r\n <ng-container *ngIf=\"pointOpen\">\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\"> \r\n {{pointOpen.upvotes}}\r\n </div>\r\n <button mat-icon-button>\r\n <mat-icon>thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"!pointSubChat\">\r\n Error: No subchat\r\n </div>\r\n \r\n <banta-comment-view\r\n class=\"subcomments\"\r\n *ngIf=\"pointSubChat\"\r\n [newestLast]=\"true\"\r\n [allowReplies]=\"false\"\r\n [source]=\"pointSubChat\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n >\r\n \r\n <banta-comment\r\n class=\"focused-comment\"\r\n data-before\r\n *ngIf=\"pointOpen\"\r\n (upvoted)=\"upvoteMessage(pointOpen)\"\r\n (userSelected)=\"showProfile(pointOpen.user)\"\r\n (reported)=\"reportMessage(pointOpen)\"\r\n [showReplyAction]=\"false\"\r\n [message]=\"pointOpen\"\r\n ></banta-comment>\r\n \r\n <div class=\"message reply\">\r\n Reply:\r\n <form class=\"new-message\" (submit)=\"sendPointSubMessage()\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"newPointSubMessageKeyDown($event)\"\r\n [(ngModel)]=\"newPointSubMessage.message\"></textarea>\r\n \r\n <div class=\"actions\">\r\n <button [disabled]=\"!newPointSubMessage.message\" \r\n mat-raised-button color=\"primary\">Send</button>\r\n </div>\r\n </form>\r\n </div>\r\n </banta-comment-view>\r\n </div>\r\n <div class=\"points-section\">\r\n <banta-comments\r\n [source]=\"pointSource\"\r\n (signInSelected)=\"showSignIn()\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n (selected)=\"goToMessage($event)\"\r\n (userSelected)=\"showProfile($event.user)\"\r\n ></banta-comments>\r\n </div>\r\n</div>",
7972
- styles: [":host{display:flex;flex-direction:row;padding:.5em;height:40em;position:relative}.counted-action{display:flex;align-items:center}.count-indicator{font-size:9pt;padding:0 3px;border-radius:3px;border:1px solid #333}header{position:relative;margin-bottom:1em}header div{display:flex;align-items:center;height:30px}header button{color:#666}header label{text-transform:uppercase;z-index:1;font-size:12pt;letter-spacing:2px;font-weight:100;color:#333;margin:0 auto 0 0;display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;white-space:nowrap;overflow-x:hidden;text-overflow:ellipsis}header:after{content:\"\";border:1px solid #ccc;height:0;width:100%;display:block;position:relative;z-index:0}.points{max-width:50em;display:flex;flex-direction:column}:host.point-focus .points{width:66%;max-width:50em}:host.point-focus .points .points-section{opacity:0;pointer-events:none}:host.point-focus .points .point-focus{opacity:1;pointer-events:initial}:host.point-focus .points .point-focus .actions{display:flex}banta-comments{flex-grow:1}.points{width:33%;margin-left:.5em;font-size:12pt;flex-shrink:0;max-width:30em;transition:width .2s ease-in,max-width .2s ease-in;position:relative}.points .points-section{flex-grow:1;display:flex;flex-direction:column;opacity:1;transition:opacity .2s ease-in;z-index:2}.points .point-focus{position:absolute;width:100%;bottom:0;top:1.75em;right:0;left:0;padding:.5em;opacity:0;transition:opacity .2s ease-in;flex-grow:1;display:flex;flex-direction:column}.firehose{flex-grow:1;font-size:10pt;display:flex;flex-direction:column}form{display:flex;padding:.5em 0;align-items:center}form textarea{font-size:14pt;background:#000;color:#fff;border:1px solid #333;min-height:6em;width:100%}form input[type=text]{background:#000;color:#fff;border:1px solid #333;width:100%;height:1em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}.subcomments ::ng-deep banta-comment{font-size:10pt}.subcomments ::ng-deep banta-comment.focused-comment{background:#001321;color:#fff;font-size:12pt}.aux{width:0;min-width:0;overflow-x:hidden;transition:width .4s ease-out,min-width .4s ease-out;display:flex;flex-direction:column}.aux.open{width:30em;min-width:18em}.aux .aux-contents{width:30em;min-width:10em;max-width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1}.notifications .notification{border-bottom:1px solid #333;padding:1em}.notifications .notification banta-timestamp{display:block;text-align:right;font-size:9pt;color:#999}.message.reply{padding:1em}.tabs{display:none}@media (max-width:1015px){:host{flex-direction:column}.tabs{display:flex;position:absolute;top:0;left:0;right:0;width:100%;z-index:10;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:rgba(0,0,0,.5)}.points{width:100%;max-width:100%;margin-left:0}header{display:none}:host.point-focus .points{width:100%;max-width:100%}.aux{width:100%;min-width:initial;max-width:100%}.aux,.firehose,.points{position:absolute;top:2em;left:0;right:0;bottom:0;z-index:0;background:#000}.aux.focus,.firehose.focus,.points.focus{z-index:2}}:host-context(.mat-dark-theme) :host{background:#090909;color:#fff}:host-context(.mat-dark-theme) form textarea{background:#ccc;color:#333}:host-context(.mat-dark-theme) header:after{border-color:#222}:host-context(.mat-dark-theme) header label{color:#aaa}"]
7973
- }),
7974
- __metadata("design:paramtypes", [BantaService,
7975
- ChatBackendService,
7976
- dialog.MatDialog])
7977
- ], BantaComponent);
7978
- return BantaComponent;
7979
- }());
7921
+ return BantaChatComponent;
7922
+ }());
7923
+ BantaChatComponent.decorators = [
7924
+ { type: core.Component, args: [{
7925
+ selector: 'banta-chat',
7926
+ template: "<banta-chat-view \r\n #chatView\r\n [source]=\"source\"\r\n (upvoted)=\"upvote($event)\"\r\n (reported)=\"report($event)\"\r\n (selected)=\"select($event)\"\r\n (userSelected)=\"selectUser($event)\"\r\n ></banta-chat-view>\r\n\r\n<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n \r\n <div class=\"entry-container\">\r\n <input\r\n type=\"text\"\r\n name=\"message\" \r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessage.message\" />\r\n \r\n <emoji-selector-button\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n\r\n <div class=\"actions\">\r\n\r\n <ng-container *ngIf=\"!user\">\r\n <button type=\"button\" (click)=\"showSignIn()\" mat-raised-button color=\"primary\">{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button *ngIf=\"canChat\" [disabled]=\"!newMessage.message\" mat-raised-button color=\"primary\">{{sendLabel}}</button>\r\n <button *ngIf=\"!canChat\" type=\"button\" (click)=\"sendPermissionError()\" mat-raised-button color=\"primary\">{{permissionDeniedLabel}}</button>\r\n </ng-container>\r\n </div>\r\n</form>",
7927
+ styles: [":host{border-radius:5px;flex-direction:column;font-size:10pt;padding:10px}.entry-container,:host{display:flex;flex-grow:1}.entry-container{flex-direction:row;position:relative}.entry-container emoji-selector-button{position:absolute;right:0;top:.15em}.entry-container input{font-size:12pt;height:2.6em;padding-left:1em}.entry-container input:-webkit-autofill,.entry-container input:-webkit-autofill:focus,.entry-container input:-webkit-autofill:hover{-webkit-box-shadow:0 0 0 1000px #211e07 inset;-webkit-text-fill-color:#9da302;-webkit-transition:background-color 5000s ease-in-out 0s;caret-color:#9da302;outline:1px solid #9da302;transition:background-color 5000s ease-in-out 0s}.entry-container emoji-selector-panel{bottom:3.5em;opacity:0;pointer-events:none;position:absolute;right:0}.entry-container emoji-selector-panel.visible{opacity:1;pointer-events:auto}form{align-items:center;display:flex;padding:.5em 0}form textarea{background:#000;border:1px solid #333;color:#fff;font-size:14pt;min-height:6em;width:100%}form input[type=text]{background:#fff;border:1px solid #ccc;color:#000;height:2.5em;width:100%}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}:host-context(.mat-dark-theme) form input[type=text]{background:#000;border:1px solid #333;color:#fff}"]
7928
+ },] }
7929
+ ];
7930
+ BantaChatComponent.ctorParameters = function () { return [
7931
+ { type: BantaService },
7932
+ { type: ChatBackendService },
7933
+ { type: core.ElementRef }
7934
+ ]; };
7935
+ BantaChatComponent.propDecorators = {
7936
+ source: [{ type: core.Input }],
7937
+ topicID: [{ type: core.Input }],
7938
+ signInLabel: [{ type: core.Input }],
7939
+ sendLabel: [{ type: core.Input }],
7940
+ permissionDeniedLabel: [{ type: core.Input }],
7941
+ signInSelected: [{ type: core.Output }],
7942
+ permissionDeniedError: [{ type: core.Output }],
7943
+ chatView: [{ type: core.ViewChild, args: ['chatView', { static: true },] }],
7944
+ selected: [{ type: core.Output }],
7945
+ reported: [{ type: core.Output }],
7946
+ upvoted: [{ type: core.Output }],
7947
+ userSelected: [{ type: core.Output }]
7948
+ };
7980
7949
 
7981
- var BantaLogoComponent = /** @class */ (function () {
7982
- function BantaLogoComponent() {
7950
+ var COMPONENTS$2 = [
7951
+ ChatMessageComponent,
7952
+ LiveChatMessageComponent,
7953
+ ChatViewComponent,
7954
+ BantaChatComponent
7955
+ ];
7956
+ var ChatModule = /** @class */ (function () {
7957
+ function ChatModule() {
7983
7958
  }
7984
- BantaLogoComponent = __decorate([
7985
- core.Component({
7986
- selector: 'banta-logo',
7987
- template: "banta",
7988
- styles: ["\n :host {\n font-family: 'Odibee Sans', sans-serif;\n font-size: 40pt;\n }\n\n :host.small {\n font-size: 30pt;\n }\n "]
7989
- })
7990
- ], BantaLogoComponent);
7991
- return BantaLogoComponent;
7992
- }());
7959
+ return ChatModule;
7960
+ }());
7961
+ ChatModule.decorators = [
7962
+ { type: core.NgModule, args: [{
7963
+ declarations: COMPONENTS$2,
7964
+ imports: [
7965
+ common.CommonModule,
7966
+ forms.FormsModule,
7967
+ icon.MatIconModule,
7968
+ button.MatButtonModule,
7969
+ EmojiModule
7970
+ ],
7971
+ exports: COMPONENTS$2
7972
+ },] }
7973
+ ];
7993
7974
 
7994
7975
  var LiveMessageComponent = /** @class */ (function () {
7995
7976
  function LiveMessageComponent() {
@@ -8001,21 +7982,21 @@
8001
7982
  get: function () {
8002
7983
  return this._upvoted;
8003
7984
  },
8004
- enumerable: true,
7985
+ enumerable: false,
8005
7986
  configurable: true
8006
7987
  });
8007
7988
  Object.defineProperty(LiveMessageComponent.prototype, "reported", {
8008
7989
  get: function () {
8009
7990
  return this._reported;
8010
7991
  },
8011
- enumerable: true,
7992
+ enumerable: false,
8012
7993
  configurable: true
8013
7994
  });
8014
7995
  Object.defineProperty(LiveMessageComponent.prototype, "selected", {
8015
7996
  get: function () {
8016
7997
  return this._selected;
8017
7998
  },
8018
- enumerable: true,
7999
+ enumerable: false,
8019
8000
  configurable: true
8020
8001
  });
8021
8002
  Object.defineProperty(LiveMessageComponent.prototype, "message", {
@@ -8026,7 +8007,7 @@
8026
8007
  this._message = value;
8027
8008
  this.viewType = this.getViewType(value);
8028
8009
  },
8029
- enumerable: true,
8010
+ enumerable: false,
8030
8011
  configurable: true
8031
8012
  });
8032
8013
  LiveMessageComponent.prototype.getViewType = function (message) {
@@ -8045,36 +8026,22 @@
8045
8026
  LiveMessageComponent.prototype.select = function () {
8046
8027
  this._selected.next();
8047
8028
  };
8048
- __decorate([
8049
- core.Output(),
8050
- __metadata("design:type", rxjs.Observable),
8051
- __metadata("design:paramtypes", [])
8052
- ], LiveMessageComponent.prototype, "upvoted", null);
8053
- __decorate([
8054
- core.Output(),
8055
- __metadata("design:type", rxjs.Observable),
8056
- __metadata("design:paramtypes", [])
8057
- ], LiveMessageComponent.prototype, "reported", null);
8058
- __decorate([
8059
- core.Output(),
8060
- __metadata("design:type", rxjs.Observable),
8061
- __metadata("design:paramtypes", [])
8062
- ], LiveMessageComponent.prototype, "selected", null);
8063
- __decorate([
8064
- core.Input(),
8065
- __metadata("design:type", Object),
8066
- __metadata("design:paramtypes", [Object])
8067
- ], LiveMessageComponent.prototype, "message", null);
8068
- LiveMessageComponent = __decorate([
8069
- core.Component({
8070
- selector: 'banta-live-message',
8071
- template: "\n <ng-container *ngIf=\"message\">\n <banta-live-chat-message\n *ngIf=\"viewType === 'chat'\"\n [message]=\"message\"\n (upvoted)=\"upvote(message)\"\n (reported)=\"report(message)\"\n (selected)=\"select(message)\">\n </banta-live-chat-message>\n\n <banta-live-comment \n *ngIf=\"viewType === 'comment'\"\n [message]=\"message\"\n (upvoted)=\"upvote(message)\"\n (reported)=\"report(message)\"\n (selected)=\"select(message)\">\n </banta-live-comment>\n </ng-container>\n ",
8072
- styles: [""]
8073
- }),
8074
- __metadata("design:paramtypes", [])
8075
- ], LiveMessageComponent);
8076
8029
  return LiveMessageComponent;
8077
- }());
8030
+ }());
8031
+ LiveMessageComponent.decorators = [
8032
+ { type: core.Component, args: [{
8033
+ selector: 'banta-live-message',
8034
+ template: "\n <ng-container *ngIf=\"message\">\n <banta-live-chat-message\n *ngIf=\"viewType === 'chat'\"\n [message]=\"message\"\n (upvoted)=\"upvote(message)\"\n (reported)=\"report(message)\"\n (selected)=\"select(message)\">\n </banta-live-chat-message>\n\n <banta-live-comment \n *ngIf=\"viewType === 'comment'\"\n [message]=\"message\"\n (upvoted)=\"upvote(message)\"\n (reported)=\"report(message)\"\n (selected)=\"select(message)\">\n </banta-live-comment>\n </ng-container>\n ",
8035
+ styles: [""]
8036
+ },] }
8037
+ ];
8038
+ LiveMessageComponent.ctorParameters = function () { return []; };
8039
+ LiveMessageComponent.propDecorators = {
8040
+ upvoted: [{ type: core.Output }],
8041
+ reported: [{ type: core.Output }],
8042
+ selected: [{ type: core.Output }],
8043
+ message: [{ type: core.Input }]
8044
+ };
8078
8045
 
8079
8046
  var CommentComponent = /** @class */ (function () {
8080
8047
  function CommentComponent() {
@@ -8088,28 +8055,28 @@
8088
8055
  get: function () {
8089
8056
  return this._userSelected;
8090
8057
  },
8091
- enumerable: true,
8058
+ enumerable: false,
8092
8059
  configurable: true
8093
8060
  });
8094
8061
  Object.defineProperty(CommentComponent.prototype, "reported", {
8095
8062
  get: function () {
8096
8063
  return this._reported;
8097
8064
  },
8098
- enumerable: true,
8065
+ enumerable: false,
8099
8066
  configurable: true
8100
8067
  });
8101
8068
  Object.defineProperty(CommentComponent.prototype, "upvoted", {
8102
8069
  get: function () {
8103
8070
  return this._upvoted;
8104
8071
  },
8105
- enumerable: true,
8072
+ enumerable: false,
8106
8073
  configurable: true
8107
8074
  });
8108
8075
  Object.defineProperty(CommentComponent.prototype, "selected", {
8109
8076
  get: function () {
8110
8077
  return this._selected;
8111
8078
  },
8112
- enumerable: true,
8079
+ enumerable: false,
8113
8080
  configurable: true
8114
8081
  });
8115
8082
  CommentComponent.prototype.report = function () {
@@ -8131,83 +8098,71 @@
8131
8098
  }
8132
8099
  return null;
8133
8100
  };
8134
- __decorate([
8135
- core.Input(),
8136
- __metadata("design:type", Object)
8137
- ], CommentComponent.prototype, "message", void 0);
8138
- __decorate([
8139
- core.Input(),
8140
- __metadata("design:type", Object)
8141
- ], CommentComponent.prototype, "showReplyAction", void 0);
8142
- __decorate([
8143
- core.Output(),
8144
- __metadata("design:type", Object),
8145
- __metadata("design:paramtypes", [])
8146
- ], CommentComponent.prototype, "userSelected", null);
8147
- __decorate([
8148
- core.Output(),
8149
- __metadata("design:type", Object),
8150
- __metadata("design:paramtypes", [])
8151
- ], CommentComponent.prototype, "reported", null);
8152
- __decorate([
8153
- core.Output(),
8154
- __metadata("design:type", Object),
8155
- __metadata("design:paramtypes", [])
8156
- ], CommentComponent.prototype, "upvoted", null);
8157
- __decorate([
8158
- core.Output(),
8159
- __metadata("design:type", Object),
8160
- __metadata("design:paramtypes", [])
8161
- ], CommentComponent.prototype, "selected", null);
8162
- CommentComponent = __decorate([
8163
- core.Component({
8164
- selector: 'banta-comment',
8165
- template: "\r\n<mat-menu #pointItemMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"report()\">Report</button>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"message-content\">\r\n <div class=\"user\">\r\n <div class=\"avatar\" \r\n (click)=\"selectUser()\"\r\n [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label class=\"display-name\" (click)=\"selectUser()\">{{message.user.displayName}}</label>\r\n <label class=\"username\" (click)=\"selectUser()\">@{{message.user.username}}</label>\r\n\r\n <button mat-icon-button [matMenuTriggerFor]=\"pointItemMenu\">\r\n <mat-icon [inline]=\"true\">more_vert</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"content\" (click)=\"select()\">\r\n {{message.message}}\r\n </div>\r\n \r\n <div class=\"actions\">\r\n <banta-timestamp [value]=\"message.sentAt\"></banta-timestamp>\r\n <div class=\"spacer\"></div>\r\n <div class=\"counted-action\" *ngIf=\"showReplyAction\">\r\n <div class=\"count-indicator\">\r\n {{message.submessages?.length || 0}}\r\n </div>\r\n <button mat-icon-button matTooltip=\"Comment\" matTooltipPosition=\"below\" (click)=\"select()\">\r\n <mat-icon [inline]=\"true\">comment</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\"> \r\n {{message.upvotes}}\r\n </div>\r\n <button mat-icon-button matTooltip=\"Upvote\" matTooltipPosition=\"below\" (click)=\"upvote()\">\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n",
8166
- styles: [":host{display:flex;flex-direction:column;position:relative;padding:.5em}:host:hover{background:#eee}:host .message-content .content{margin-left:4em;margin-right:3em}:host.abbreviated .message-content .content{max-height:8.5em;text-overflow:ellipsis;overflow-y:hidden}:host .actions{display:flex;padding-right:10px;margin-left:4em;align-items:center}:host .actions button{color:#666}:host .actions banta-timestamp{color:#666;font-size:10pt}.user{position:relative;margin:1em 0 0;display:flex;align-items:center}.user label{z-index:1;position:relative;padding:0 0 0 1em;font-size:10pt;color:#000;margin:0 auto 0 0;display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex-shrink:1;flex-grow:0}.user label.username{color:#666;flex-shrink:0;flex-grow:1}.avatar{height:3em;width:3em;background-position:center;background-size:cover;background-color:#333;border-radius:100%;flex-shrink:0;flex-grow:0}.counted-action{display:flex;align-items:center}.count-indicator{font-size:9pt;padding:0 3px;border-radius:3px;border:1px solid #ccc;color:#666}:host-context(.mat-dark-theme) .count-indicator{border-color:#333}:host-context(.mat-dark-theme):hover{background:#060606}:host-context(.mat-dark-theme) .user label{color:#fff}"]
8167
- })
8168
- ], CommentComponent);
8169
8101
  return CommentComponent;
8170
- }());
8102
+ }());
8103
+ CommentComponent.decorators = [
8104
+ { type: core.Component, args: [{
8105
+ selector: 'banta-comment',
8106
+ template: "\r\n<mat-menu #pointItemMenu=\"matMenu\">\r\n <button mat-menu-item (click)=\"report()\">Report</button>\r\n <button mat-menu-item>Help</button>\r\n</mat-menu>\r\n\r\n<div class=\"message-content\">\r\n <div class=\"user\">\r\n <div class=\"avatar\" \r\n (click)=\"selectUser()\"\r\n [style.background-image]=\"avatarForUser(message.user)\"></div>\r\n <label class=\"display-name\" (click)=\"selectUser()\">{{message.user.displayName}}</label>\r\n <label class=\"username\" (click)=\"selectUser()\">@{{message.user.username}}</label>\r\n\r\n <button mat-icon-button [matMenuTriggerFor]=\"pointItemMenu\">\r\n <mat-icon [inline]=\"true\">more_vert</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"content\" (click)=\"select()\">\r\n {{message.message}}\r\n </div>\r\n \r\n <div class=\"actions\">\r\n <banta-timestamp [value]=\"message.sentAt\"></banta-timestamp>\r\n <div class=\"spacer\"></div>\r\n <div class=\"counted-action\" *ngIf=\"showReplyAction\">\r\n <div class=\"count-indicator\">\r\n {{message.submessages?.length || 0}}\r\n </div>\r\n <button mat-icon-button matTooltip=\"Comment\" matTooltipPosition=\"below\" (click)=\"select()\">\r\n <mat-icon [inline]=\"true\">comment</mat-icon>\r\n </button>\r\n </div>\r\n <div class=\"counted-action\">\r\n <div class=\"count-indicator\"> \r\n {{message.upvotes}}\r\n </div>\r\n <button mat-icon-button matTooltip=\"Upvote\" matTooltipPosition=\"below\" (click)=\"upvote()\">\r\n <mat-icon [inline]=\"true\">thumb_up</mat-icon>\r\n </button>\r\n </div>\r\n </div>\r\n</div>\r\n",
8107
+ styles: [":host{display:flex;flex-direction:column;padding:.5em;position:relative}:host:hover{background:#eee}:host .message-content .content{margin-left:4em;margin-right:3em}:host.abbreviated .message-content .content{max-height:8.5em;overflow-y:hidden;text-overflow:ellipsis}:host .actions{align-items:center;display:flex;margin-left:4em;padding-right:10px}:host .actions button{color:#666}:host .actions banta-timestamp{color:#666;font-size:10pt}.user{align-items:center;display:flex;margin:1em 0 0;position:relative}.user label{color:#000;display:block;flex-grow:0;flex-shrink:1;font-size:10pt;margin:0 auto 0 0;max-width:100%;overflow:hidden;padding:0 0 0 1em;position:relative;text-overflow:ellipsis;white-space:nowrap;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;z-index:1}.user label.username{color:#666;flex-grow:1;flex-shrink:0}.avatar{background-color:#333;background-position:50%;background-size:cover;border-radius:100%;flex-grow:0;flex-shrink:0;height:3em;width:3em}.counted-action{align-items:center;display:flex}.count-indicator{border:1px solid #ccc;border-radius:3px;color:#666;font-size:9pt;padding:0 3px}:host-context(.mat-dark-theme) .count-indicator{border-color:#333}:host-context(.mat-dark-theme):hover{background:#060606}:host-context(.mat-dark-theme) .user label{color:#fff}"]
8108
+ },] }
8109
+ ];
8110
+ CommentComponent.propDecorators = {
8111
+ message: [{ type: core.Input }],
8112
+ showReplyAction: [{ type: core.Input }],
8113
+ userSelected: [{ type: core.Output }],
8114
+ reported: [{ type: core.Output }],
8115
+ upvoted: [{ type: core.Output }],
8116
+ selected: [{ type: core.Output }]
8117
+ };
8171
8118
 
8172
8119
  var CommentViewComponent = /** @class */ (function () {
8173
- function CommentViewComponent() {
8120
+ function CommentViewComponent(backend) {
8121
+ this.backend = backend;
8174
8122
  this._sourceSubs = new subsink.SubSink();
8175
8123
  this._selected = new rxjs.Subject();
8176
8124
  this._upvoted = new rxjs.Subject();
8177
8125
  this._reported = new rxjs.Subject();
8178
8126
  this._userSelected = new rxjs.Subject();
8127
+ this.showEmptyState = true;
8179
8128
  this.allowReplies = true;
8180
8129
  this.menuMessage = null;
8181
8130
  this.messages = [];
8182
- this.maxMessages = 200;
8131
+ this.maxMessages = 2000;
8132
+ this.maxVisibleMessages = 200;
8183
8133
  this.newestLast = false;
8134
+ this.isViewingMore = false;
8135
+ this.isLoadingMore = false;
8136
+ this.hasMore = false;
8137
+ this.newMessages = [];
8138
+ this.olderMessages = [];
8184
8139
  }
8185
8140
  Object.defineProperty(CommentViewComponent.prototype, "selected", {
8186
8141
  get: function () {
8187
8142
  return this._selected;
8188
8143
  },
8189
- enumerable: true,
8144
+ enumerable: false,
8190
8145
  configurable: true
8191
8146
  });
8192
8147
  Object.defineProperty(CommentViewComponent.prototype, "userSelected", {
8193
8148
  get: function () {
8194
8149
  return this._userSelected;
8195
8150
  },
8196
- enumerable: true,
8151
+ enumerable: false,
8197
8152
  configurable: true
8198
8153
  });
8199
8154
  Object.defineProperty(CommentViewComponent.prototype, "reported", {
8200
8155
  get: function () {
8201
8156
  return this._reported;
8202
8157
  },
8203
- enumerable: true,
8158
+ enumerable: false,
8204
8159
  configurable: true
8205
8160
  });
8206
8161
  Object.defineProperty(CommentViewComponent.prototype, "upvoted", {
8207
8162
  get: function () {
8208
8163
  return this._upvoted;
8209
8164
  },
8210
- enumerable: true,
8165
+ enumerable: false,
8211
8166
  configurable: true
8212
8167
  });
8213
8168
  Object.defineProperty(CommentViewComponent.prototype, "source", {
@@ -8222,9 +8177,11 @@
8222
8177
  }
8223
8178
  this._source = value;
8224
8179
  if (value) {
8225
- var messages = value.messages || [];
8180
+ var messages = (value.messages || []).slice();
8181
+ this.messages = messages;
8182
+ this.olderMessages = messages.splice(this.maxVisibleMessages, messages.length);
8183
+ this.hasMore = this.olderMessages.length > 0;
8226
8184
  this._sourceSubs = new subsink.SubSink();
8227
- this.messages = messages.slice();
8228
8185
  this._sourceSubs.add(this._source.messageReceived
8229
8186
  .subscribe(function (msg) { return _this.messageReceived(msg); }), this._source.messageSent
8230
8187
  .subscribe(function (msg) { return _this.messageSent(msg); }));
@@ -8233,7 +8190,7 @@
8233
8190
  }
8234
8191
  }
8235
8192
  },
8236
- enumerable: true,
8193
+ enumerable: false,
8237
8194
  configurable: true
8238
8195
  });
8239
8196
  CommentViewComponent.prototype.upvoteMessage = function (message) {
@@ -8243,22 +8200,82 @@
8243
8200
  this._reported.next(message);
8244
8201
  };
8245
8202
  CommentViewComponent.prototype.selectMessage = function (message) {
8246
- this._selected.next(message);
8203
+ return __awaiter(this, void 0, void 0, function () {
8204
+ return __generator(this, function (_a) {
8205
+ this._selected.next(message);
8206
+ return [2 /*return*/];
8207
+ });
8208
+ });
8247
8209
  };
8248
8210
  CommentViewComponent.prototype.selectMessageUser = function (message) {
8249
8211
  this._userSelected.next(message);
8250
8212
  };
8213
+ CommentViewComponent.prototype.messageIdentity = function (chatMessage) {
8214
+ return chatMessage.id;
8215
+ };
8216
+ CommentViewComponent.prototype.showNew = function () {
8217
+ return __awaiter(this, void 0, void 0, function () {
8218
+ var overflow;
8219
+ return __generator(this, function (_a) {
8220
+ this.isViewingMore = false;
8221
+ this.messages = this.newMessages.splice(0, this.newMessages.length).concat(this.messages);
8222
+ overflow = this.messages.splice(this.maxVisibleMessages, this.messages.length);
8223
+ this.olderMessages = overflow.concat(this.olderMessages);
8224
+ this.olderMessages.splice(this.maxMessages - this.maxVisibleMessages, this.olderMessages.length);
8225
+ return [2 /*return*/];
8226
+ });
8227
+ });
8228
+ };
8229
+ CommentViewComponent.prototype.showMore = function () {
8230
+ return __awaiter(this, void 0, void 0, function () {
8231
+ var lastMessage, messages;
8232
+ return __generator(this, function (_a) {
8233
+ switch (_a.label) {
8234
+ case 0:
8235
+ this.isViewingMore = true;
8236
+ if (!(this.olderMessages.length > 0)) return [3 /*break*/, 1];
8237
+ this.isLoadingMore = false;
8238
+ this.messages = this.messages.concat(this.olderMessages.splice(0, 50));
8239
+ return [3 /*break*/, 4];
8240
+ case 1:
8241
+ if (!this.source.loadAfter) return [3 /*break*/, 3];
8242
+ this.isLoadingMore = true;
8243
+ lastMessage = this.messages[this.messages.length - 1];
8244
+ return [4 /*yield*/, this.source.loadAfter(lastMessage, 100)];
8245
+ case 2:
8246
+ messages = _a.sent();
8247
+ this.messages = this.messages.concat(messages);
8248
+ this.isLoadingMore = false;
8249
+ if (messages.length === 0)
8250
+ this.hasMore = false;
8251
+ return [3 /*break*/, 4];
8252
+ case 3:
8253
+ this.hasMore = false;
8254
+ _a.label = 4;
8255
+ case 4: return [2 /*return*/];
8256
+ }
8257
+ });
8258
+ });
8259
+ };
8251
8260
  CommentViewComponent.prototype.addMessage = function (message) {
8261
+ var destination = this.messages;
8262
+ var bucket = this.olderMessages;
8263
+ if (this.isViewingMore) {
8264
+ destination = this.newMessages;
8265
+ bucket = null;
8266
+ }
8252
8267
  if (this.newestLast) {
8253
- while (this.messages.length + 1 > this.maxMessages)
8254
- this.messages.shift();
8255
- this.messages.push(message);
8268
+ destination.push(message);
8269
+ var overflow = destination.splice(this.maxVisibleMessages, destination.length);
8270
+ bucket === null || bucket === void 0 ? void 0 : bucket.push.apply(bucket, __spread(overflow));
8256
8271
  }
8257
8272
  else {
8258
- while (this.messages.length + 1 > this.maxMessages)
8259
- this.messages.pop();
8260
- this.messages.unshift(message);
8273
+ destination.unshift(message);
8274
+ var overflow = destination.splice(this.maxVisibleMessages, destination.length);
8275
+ bucket === null || bucket === void 0 ? void 0 : bucket.unshift.apply(bucket, __spread(overflow));
8261
8276
  }
8277
+ if ((bucket === null || bucket === void 0 ? void 0 : bucket.length) > 0)
8278
+ this.hasMore = true;
8262
8279
  };
8263
8280
  CommentViewComponent.prototype.messageReceived = function (message) {
8264
8281
  var _this = this;
@@ -8299,61 +8316,33 @@
8299
8316
  url = user.avatarUrl;
8300
8317
  return "url(" + url + ")";
8301
8318
  };
8302
- __decorate([
8303
- core.Input(),
8304
- __metadata("design:type", Object)
8305
- ], CommentViewComponent.prototype, "allowReplies", void 0);
8306
- __decorate([
8307
- core.Output(),
8308
- __metadata("design:type", Object),
8309
- __metadata("design:paramtypes", [])
8310
- ], CommentViewComponent.prototype, "selected", null);
8311
- __decorate([
8312
- core.Output(),
8313
- __metadata("design:type", Object),
8314
- __metadata("design:paramtypes", [])
8315
- ], CommentViewComponent.prototype, "userSelected", null);
8316
- __decorate([
8317
- core.Output(),
8318
- __metadata("design:type", Object),
8319
- __metadata("design:paramtypes", [])
8320
- ], CommentViewComponent.prototype, "reported", null);
8321
- __decorate([
8322
- core.Output(),
8323
- __metadata("design:type", Object),
8324
- __metadata("design:paramtypes", [])
8325
- ], CommentViewComponent.prototype, "upvoted", null);
8326
- __decorate([
8327
- core.Input(),
8328
- __metadata("design:type", Object),
8329
- __metadata("design:paramtypes", [Object])
8330
- ], CommentViewComponent.prototype, "source", null);
8331
- __decorate([
8332
- core.Input(),
8333
- __metadata("design:type", String)
8334
- ], CommentViewComponent.prototype, "genericAvatarUrl", void 0);
8335
- __decorate([
8336
- core.ViewChild('messageContainer'),
8337
- __metadata("design:type", core.ElementRef)
8338
- ], CommentViewComponent.prototype, "messageContainer", void 0);
8339
- __decorate([
8340
- core.Input(),
8341
- __metadata("design:type", Object)
8342
- ], CommentViewComponent.prototype, "maxMessages", void 0);
8343
- __decorate([
8344
- core.Input(),
8345
- __metadata("design:type", Object)
8346
- ], CommentViewComponent.prototype, "newestLast", void 0);
8347
- CommentViewComponent = __decorate([
8348
- core.Component({
8349
- selector: 'banta-comment-view',
8350
- template: "<div class=\"message-container\">\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n <banta-comment \r\n *ngFor=\"let message of messages\"\r\n class=\"abbreviated\"\r\n [message]=\"message\"\r\n [showReplyAction]=\"allowReplies\"\r\n (userSelected)=\"selectMessageUser(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (selected)=\"selectMessage(message)\"\r\n ></banta-comment>\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>",
8351
- styles: [":host{flex-grow:1;display:flex;flex-direction:column;opacity:1;transition:opacity .2s ease-in}.message-container{flex-grow:1;overflow-y:auto;overflow-x:hidden;height:10em;color:#000;background:#fff;padding:.5em 1em .5em .5em}.message-container.no-scroll{height:auto;overflow-y:visible}:host-context(.mat-dark-theme) .message-container{color:#fff;background:#000}"]
8352
- }),
8353
- __metadata("design:paramtypes", [])
8354
- ], CommentViewComponent);
8355
8319
  return CommentViewComponent;
8356
- }());
8320
+ }());
8321
+ CommentViewComponent.decorators = [
8322
+ { type: core.Component, args: [{
8323
+ selector: 'banta-comment-view',
8324
+ template: "<div class=\"message-container\">\r\n <ng-content select=\"[data-before]\"></ng-content>\r\n \r\n <a mat-button class=\"nav\" *ngIf=\"isViewingMore\" href=\"javascript:;\" (click)=\"showNew()\">\r\n Show \r\n <ng-container *ngIf=\"newMessages.length === 1\">\r\n {{newMessages.length}} new message\r\n </ng-container>\r\n <ng-container *ngIf=\"newMessages.length > 1\">\r\n {{newMessages.length}} new messages\r\n </ng-container>\r\n <ng-container *ngIf=\"newMessages.length === 0\">\r\n new messages\r\n </ng-container>\r\n </a>\r\n\r\n <ng-container *ngIf=\"messages.length === 0\">\r\n <div class=\"empty-state\" *ngIf=\"showEmptyState\">\r\n Be the first to comment!\r\n </div>\r\n </ng-container>\r\n <banta-comment \r\n *ngFor=\"let message of messages; trackBy: messageIdentity\"\r\n class=\"abbreviated\"\r\n [message]=\"message\"\r\n [showReplyAction]=\"allowReplies\"\r\n (userSelected)=\"selectMessageUser(message)\"\r\n (upvoted)=\"upvoteMessage(message)\"\r\n (reported)=\"reportMessage(message)\"\r\n (selected)=\"selectMessage(message)\"\r\n ></banta-comment>\r\n\r\n <a mat-button class=\"nav\" *ngIf=\"hasMore && !isLoadingMore\" href=\"javascript:;\" (click)=\"showMore()\">Show more</a>\r\n\r\n <div class=\"loading-more\" *ngIf=\"isLoadingMore\">\r\n <mat-spinner></mat-spinner>\r\n </div>\r\n\r\n <!-- <div style=\"color: #666\">\r\n n={{newMessages.length}}, m={{messages.length}}, o={{olderMessages.length}},\r\n v={{maxVisibleMessages}}, M={{maxMessages}}\r\n </div> -->\r\n\r\n <ng-content select=\":not([data-before])\"></ng-content>\r\n</div>",
8325
+ styles: [":host{display:flex;flex-direction:column;flex-grow:1;opacity:1;transition:opacity .2s ease-in}.message-container{background:#fff;color:#000;flex-grow:1;opacity:1;overflow-x:hidden;padding:.5em 1em .5em .5em;position:relative;transition:opacity .5s ease-in-out}.message-container.no-scroll{height:auto;overflow-y:visible}.message-container.faded{opacity:.25}.message-container .overlay{bottom:0;left:0;position:absolute;right:0;top:0;z-index:10}:host.fixed-height .message-container{overflow-y:auto}:host-context(.mat-dark-theme) .message-container{background:#000;color:#fff}.empty-state{color:#666;margin:3em;text-align:center}:host-context(.mat-dark-theme) .empty-state{color:#666}a.nav{text-transform:uppercase;width:100%}.loading-more,a.nav{padding:2em;text-align:center}.loading-more{margin:0 auto;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}"]
8326
+ },] }
8327
+ ];
8328
+ CommentViewComponent.ctorParameters = function () { return [
8329
+ { type: ChatBackendService }
8330
+ ]; };
8331
+ CommentViewComponent.propDecorators = {
8332
+ showEmptyState: [{ type: core.Input }],
8333
+ allowReplies: [{ type: core.Input }],
8334
+ fixedHeight: [{ type: core.Input }, { type: core.HostBinding, args: ['class.fixed-height',] }],
8335
+ selected: [{ type: core.Output }],
8336
+ userSelected: [{ type: core.Output }],
8337
+ reported: [{ type: core.Output }],
8338
+ upvoted: [{ type: core.Output }],
8339
+ source: [{ type: core.Input }],
8340
+ genericAvatarUrl: [{ type: core.Input }],
8341
+ messageContainer: [{ type: core.ViewChild, args: ['messageContainer',] }],
8342
+ maxMessages: [{ type: core.Input }],
8343
+ maxVisibleMessages: [{ type: core.Input }],
8344
+ newestLast: [{ type: core.Input }]
8345
+ };
8357
8346
 
8358
8347
  /**
8359
8348
  * Comments component
@@ -8387,7 +8376,7 @@
8387
8376
  set: function (value) {
8388
8377
  this._source = value;
8389
8378
  },
8390
- enumerable: true,
8379
+ enumerable: false,
8391
8380
  configurable: true
8392
8381
  });
8393
8382
  Object.defineProperty(BantaCommentsComponent.prototype, "topicID", {
@@ -8397,22 +8386,22 @@
8397
8386
  set: function (value) {
8398
8387
  this.setSourceFromTopicID(value);
8399
8388
  },
8400
- enumerable: true,
8389
+ enumerable: false,
8401
8390
  configurable: true
8402
8391
  });
8403
8392
  BantaCommentsComponent.prototype.setSourceFromTopicID = function (topicID) {
8404
8393
  return __awaiter(this, void 0, void 0, function () {
8405
- var _a;
8406
- return __generator(this, function (_b) {
8407
- switch (_b.label) {
8394
+ var _b;
8395
+ return __generator(this, function (_c) {
8396
+ switch (_c.label) {
8408
8397
  case 0:
8409
8398
  if (this._source && this._source.close)
8410
8399
  this._source.close();
8411
8400
  this._source = null;
8412
- _a = this;
8401
+ _b = this;
8413
8402
  return [4 /*yield*/, this.backend.getSourceForTopic(topicID)];
8414
8403
  case 1:
8415
- _a._source = _b.sent();
8404
+ _b._source = _c.sent();
8416
8405
  return [2 /*return*/];
8417
8406
  }
8418
8407
  });
@@ -8425,14 +8414,14 @@
8425
8414
  get: function () {
8426
8415
  return this._signInSelected;
8427
8416
  },
8428
- enumerable: true,
8417
+ enumerable: false,
8429
8418
  configurable: true
8430
8419
  });
8431
8420
  Object.defineProperty(BantaCommentsComponent.prototype, "permissionDeniedError", {
8432
8421
  get: function () {
8433
8422
  return this._permissionDeniedError;
8434
8423
  },
8435
- enumerable: true,
8424
+ enumerable: false,
8436
8425
  configurable: true
8437
8426
  });
8438
8427
  BantaCommentsComponent.prototype.showPermissionDenied = function () {
@@ -8445,35 +8434,35 @@
8445
8434
  return true;
8446
8435
  return (_a = this.user.permissions) === null || _a === void 0 ? void 0 : _a.canComment(this.source);
8447
8436
  },
8448
- enumerable: true,
8437
+ enumerable: false,
8449
8438
  configurable: true
8450
8439
  });
8451
8440
  Object.defineProperty(BantaCommentsComponent.prototype, "upvoted", {
8452
8441
  get: function () {
8453
8442
  return this._upvoted;
8454
8443
  },
8455
- enumerable: true,
8444
+ enumerable: false,
8456
8445
  configurable: true
8457
8446
  });
8458
8447
  Object.defineProperty(BantaCommentsComponent.prototype, "reported", {
8459
8448
  get: function () {
8460
8449
  return this._reported;
8461
8450
  },
8462
- enumerable: true,
8451
+ enumerable: false,
8463
8452
  configurable: true
8464
8453
  });
8465
8454
  Object.defineProperty(BantaCommentsComponent.prototype, "selected", {
8466
8455
  get: function () {
8467
8456
  return this._selected;
8468
8457
  },
8469
- enumerable: true,
8458
+ enumerable: false,
8470
8459
  configurable: true
8471
8460
  });
8472
8461
  Object.defineProperty(BantaCommentsComponent.prototype, "userSelected", {
8473
8462
  get: function () {
8474
8463
  return this._userSelected;
8475
8464
  },
8476
- enumerable: true,
8465
+ enumerable: false,
8477
8466
  configurable: true
8478
8467
  });
8479
8468
  BantaCommentsComponent.prototype.onKeyDown = function (event) {
@@ -8481,20 +8470,45 @@
8481
8470
  BantaCommentsComponent.prototype.insertEmoji = function (text) {
8482
8471
  this.newMessageText += text;
8483
8472
  };
8473
+ BantaCommentsComponent.prototype.onReplyKeyDown = function (event) {
8474
+ };
8475
+ BantaCommentsComponent.prototype.insertReplyEmoji = function (text) {
8476
+ this.replyMessage += text;
8477
+ };
8484
8478
  BantaCommentsComponent.prototype.sendMessage = function () {
8485
- if (!this.source)
8486
- return;
8487
- var text = (this.newMessageText || '').trim();
8488
- this.newMessageText = '';
8489
- if (text === '')
8490
- return;
8491
- var message = {
8492
- user: this.user,
8493
- sentAt: Date.now(),
8494
- upvotes: 0,
8495
- message: text
8496
- };
8497
- this.source.send(message);
8479
+ return __awaiter(this, void 0, void 0, function () {
8480
+ var text, message, e_1;
8481
+ return __generator(this, function (_b) {
8482
+ switch (_b.label) {
8483
+ case 0:
8484
+ if (!this.source)
8485
+ return [2 /*return*/];
8486
+ text = (this.newMessageText || '').trim();
8487
+ this.newMessageText = '';
8488
+ if (text === '')
8489
+ return [2 /*return*/];
8490
+ message = {
8491
+ user: this.user,
8492
+ sentAt: Date.now(),
8493
+ upvotes: 0,
8494
+ message: text
8495
+ };
8496
+ _b.label = 1;
8497
+ case 1:
8498
+ _b.trys.push([1, 3, , 4]);
8499
+ return [4 /*yield*/, this.source.send(message)];
8500
+ case 2:
8501
+ _b.sent();
8502
+ return [3 /*break*/, 4];
8503
+ case 3:
8504
+ e_1 = _b.sent();
8505
+ console.error("Failed to send message: ", message);
8506
+ console.error(e_1);
8507
+ return [3 /*break*/, 4];
8508
+ case 4: return [2 /*return*/];
8509
+ }
8510
+ });
8511
+ });
8498
8512
  };
8499
8513
  BantaCommentsComponent.prototype.upvoteMessage = function (message) {
8500
8514
  this._upvoted.next(message);
@@ -8502,79 +8516,92 @@
8502
8516
  BantaCommentsComponent.prototype.reportMessage = function (message) {
8503
8517
  this._reported.next(message);
8504
8518
  };
8519
+ BantaCommentsComponent.prototype.unselectMessage = function () {
8520
+ return __awaiter(this, void 0, void 0, function () {
8521
+ return __generator(this, function (_b) {
8522
+ this._selected.next(null);
8523
+ this.selectedMessage = null;
8524
+ if (this.selectedMessageThread) {
8525
+ if (this.selectedMessageThread.close)
8526
+ this.selectedMessageThread.close();
8527
+ this.selectedMessageThread = null;
8528
+ }
8529
+ return [2 /*return*/];
8530
+ });
8531
+ });
8532
+ };
8505
8533
  BantaCommentsComponent.prototype.selectMessage = function (message) {
8506
- this._selected.next(message);
8534
+ return __awaiter(this, void 0, void 0, function () {
8535
+ var _b;
8536
+ return __generator(this, function (_c) {
8537
+ switch (_c.label) {
8538
+ case 0:
8539
+ this._selected.next(message);
8540
+ this.selectedMessage = message;
8541
+ _b = this;
8542
+ return [4 /*yield*/, this.backend.getSourceForThread(this.topicID, message.id)];
8543
+ case 1:
8544
+ _b.selectedMessageThread = _c.sent();
8545
+ return [2 /*return*/];
8546
+ }
8547
+ });
8548
+ });
8507
8549
  };
8508
8550
  BantaCommentsComponent.prototype.selectMessageUser = function (message) {
8509
8551
  this._userSelected.next(message);
8510
8552
  };
8511
- BantaCommentsComponent.ctorParameters = function () { return [
8512
- { type: BantaService },
8513
- { type: ChatBackendService }
8514
- ]; };
8515
- __decorate([
8516
- core.Input(),
8517
- __metadata("design:type", Object),
8518
- __metadata("design:paramtypes", [Object])
8519
- ], BantaCommentsComponent.prototype, "source", null);
8520
- __decorate([
8521
- core.Input(),
8522
- __metadata("design:type", String),
8523
- __metadata("design:paramtypes", [Object])
8524
- ], BantaCommentsComponent.prototype, "topicID", null);
8525
- __decorate([
8526
- core.Input(),
8527
- __metadata("design:type", Object)
8528
- ], BantaCommentsComponent.prototype, "signInLabel", void 0);
8529
- __decorate([
8530
- core.Input(),
8531
- __metadata("design:type", Object)
8532
- ], BantaCommentsComponent.prototype, "sendLabel", void 0);
8533
- __decorate([
8534
- core.Input(),
8535
- __metadata("design:type", Object)
8536
- ], BantaCommentsComponent.prototype, "permissionDeniedLabel", void 0);
8537
- __decorate([
8538
- core.Output(),
8539
- __metadata("design:type", rxjs.Observable),
8540
- __metadata("design:paramtypes", [])
8541
- ], BantaCommentsComponent.prototype, "signInSelected", null);
8542
- __decorate([
8543
- core.Output(),
8544
- __metadata("design:type", rxjs.Observable),
8545
- __metadata("design:paramtypes", [])
8546
- ], BantaCommentsComponent.prototype, "permissionDeniedError", null);
8547
- __decorate([
8548
- core.Output(),
8549
- __metadata("design:type", Object),
8550
- __metadata("design:paramtypes", [])
8551
- ], BantaCommentsComponent.prototype, "upvoted", null);
8552
- __decorate([
8553
- core.Output(),
8554
- __metadata("design:type", Object),
8555
- __metadata("design:paramtypes", [])
8556
- ], BantaCommentsComponent.prototype, "reported", null);
8557
- __decorate([
8558
- core.Output(),
8559
- __metadata("design:type", Object),
8560
- __metadata("design:paramtypes", [])
8561
- ], BantaCommentsComponent.prototype, "selected", null);
8562
- __decorate([
8563
- core.Output(),
8564
- __metadata("design:type", Object),
8565
- __metadata("design:paramtypes", [])
8566
- ], BantaCommentsComponent.prototype, "userSelected", null);
8567
- BantaCommentsComponent = __decorate([
8568
- core.Component({
8569
- selector: 'banta-comments',
8570
- template: "\r\n<form class=\"new-message\" (submit)=\"sendMessage()\">\r\n <div class=\"text-container\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessageText\"></textarea>\r\n <emoji-selector-button \r\n class=\"top-right\"\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n <div class=\"actions\">\r\n\r\n <ng-container *ngIf=\"!user\">\r\n <button \r\n mat-raised-button \r\n color=\"primary\"\r\n type=\"button\"\r\n (click)=\"showSignIn()\"\r\n >{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button \r\n *ngIf=\"canComment\"\r\n mat-raised-button \r\n color=\"primary\"\r\n [disabled]=\"!newMessageText\" \r\n >{{sendLabel}}</button>\r\n <button \r\n *ngIf=\"!canComment\"\r\n type=\"button\"\r\n (click)=\"showPermissionDenied()\"\r\n mat-raised-button \r\n color=\"primary\"\r\n >{{permissionDeniedLabel}</button>\r\n </ng-container>\r\n </div>\r\n</form>\r\n\r\n<banta-comment-view \r\n [source]=\"source\"\r\n (userSelected)=\"selectMessageUser($event)\"\r\n (selected)=\"selectMessage($event)\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></banta-comment-view>",
8571
- styles: [":host{display:flex;flex-direction:column}form{display:flex;padding:.5em 0;align-items:center}form .text-container{position:relative;display:flex;flex-grow:1}form .text-container textarea{font-size:14pt;background-color:#fff;color:#333;border:1px solid #ccc;min-height:6em;width:100%}form .text-container emoji-selector-button{bottom:0;right:0;position:absolute}form input[type=text]{background:#000;color:#fff;border:1px solid #333;width:100%;height:1em}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}:host-context(.mat-dark-theme) form .text-container textarea{background:#000;color:#fff;border-color:#333}"]
8572
- }),
8573
- __metadata("design:paramtypes", [BantaService,
8574
- ChatBackendService])
8575
- ], BantaCommentsComponent);
8553
+ BantaCommentsComponent.prototype.sendReply = function () {
8554
+ return __awaiter(this, void 0, void 0, function () {
8555
+ return __generator(this, function (_b) {
8556
+ switch (_b.label) {
8557
+ case 0: return [4 /*yield*/, this.selectedMessageThread.send({
8558
+ message: this.replyMessage,
8559
+ parentMessageId: this.selectedMessage.id,
8560
+ upvotes: 0,
8561
+ user: this.user,
8562
+ submessages: [],
8563
+ topicId: this.topicID,
8564
+ sentAt: Date.now(),
8565
+ updatedAt: Date.now()
8566
+ })];
8567
+ case 1:
8568
+ _b.sent();
8569
+ this.replyMessage = '';
8570
+ return [2 /*return*/];
8571
+ }
8572
+ });
8573
+ });
8574
+ };
8576
8575
  return BantaCommentsComponent;
8577
- }());
8576
+ }());
8577
+ BantaCommentsComponent.decorators = [
8578
+ { type: core.Component, args: [{
8579
+ selector: 'banta-comments',
8580
+ template: "\r\n<div class=\"focused\" *ngIf=\"selectedMessage\">\r\n\r\n <div>\r\n <a mat-button href=\"javascript:;\" (click)=\"unselectMessage()\">\r\n <mat-icon>arrow_back</mat-icon>\r\n Latest Comments\r\n </a>\r\n </div>\r\n\r\n <banta-comment \r\n [message]=\"selectedMessage\"\r\n ></banta-comment>\r\n\r\n <div class=\"replies\">\r\n Reply\r\n <form class=\"new-message\" (submit)=\"sendReply()\">\r\n <div class=\"text-container\">\r\n <textarea \r\n name=\"message\" \r\n (keydown)=\"onReplyKeyDown($event)\"\r\n [(ngModel)]=\"replyMessage\"></textarea>\r\n <emoji-selector-button \r\n class=\"top-right\"\r\n (selected)=\"insertReplyEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n <button [disabled]=\"!replyMessage\" \r\n mat-raised-button color=\"primary\">Send</button>\r\n </form>\r\n <banta-comment-view \r\n [source]=\"selectedMessageThread\"\r\n [allowReplies]=\"false\"\r\n [fixedHeight]=\"false\"\r\n [showEmptyState]=\"false\"\r\n ></banta-comment-view>\r\n </div>\r\n</div>\r\n\r\n<form class=\"new-message\" (submit)=\"sendMessage()\" *ngIf=\"!selectedMessage\">\r\n <div class=\"text-container\">\r\n <textarea \r\n name=\"message\" \r\n placeholder=\"Type your comment\"\r\n (keydown)=\"onKeyDown($event)\"\r\n [(ngModel)]=\"newMessageText\"></textarea>\r\n <emoji-selector-button \r\n class=\"top-right\"\r\n (selected)=\"insertEmoji($event)\"\r\n ></emoji-selector-button>\r\n </div>\r\n <div class=\"actions\">\r\n <ng-container *ngIf=\"!user\">\r\n <button \r\n mat-raised-button \r\n color=\"primary\"\r\n type=\"button\"\r\n (click)=\"showSignIn()\"\r\n >{{signInLabel}}</button>\r\n </ng-container>\r\n <ng-container *ngIf=\"user\">\r\n <button \r\n *ngIf=\"canComment\"\r\n mat-raised-button \r\n color=\"primary\"\r\n [disabled]=\"!newMessageText\" \r\n >{{sendLabel}}</button>\r\n <button \r\n *ngIf=\"!canComment\"\r\n type=\"button\"\r\n (click)=\"showPermissionDenied()\"\r\n mat-raised-button \r\n color=\"primary\"\r\n >{{permissionDeniedLabel}}</button>\r\n </ng-container>\r\n </div>\r\n</form>\r\n\r\n<banta-comment-view \r\n [class.faded]=\"selectedMessage\"\r\n [source]=\"source\"\r\n [fixedHeight]=\"fixedHeight\"\r\n [maxMessages]=\"maxMessages\"\r\n [maxVisibleMessages]=\"maxVisibleMessages\"\r\n [genericAvatarUrl]=\"genericAvatarUrl\"\r\n (userSelected)=\"selectMessageUser($event)\"\r\n (selected)=\"selectMessage($event)\"\r\n (upvoted)=\"upvoteMessage($event)\"\r\n (reported)=\"reportMessage($event)\"\r\n ></banta-comment-view>",
8581
+ styles: [":host{flex-direction:column}:host,form{display:flex}form{align-items:center;padding:.5em 0}form .text-container{display:flex;flex-grow:1;position:relative}form .text-container textarea{background-color:#fff;border:1px solid #ccc;color:#333;font-size:14pt;min-height:6em;width:100%}form .text-container emoji-selector-button{bottom:0;position:absolute;right:0}form input[type=text]{background:#000;border:1px solid #333;color:#fff;height:1em;width:100%}form .actions{margin-left:1em}form button{display:block;margin:0 0 0 auto}:host-context(.mat-dark-theme) form .text-container textarea{background:#000;border-color:#333;color:#fff}.focused .replies{margin-left:4em;margin-top:1em}banta-comment-view{opacity:1;transition:opacity .4s ease-in-out}banta-comment-view.faded{opacity:.25}form.new-message{align-items:flex-start;display:flex}form.new-message mat-form-field{flex-grow:1}form.new-message button{margin-left:1em;margin-top:.5em}"]
8582
+ },] }
8583
+ ];
8584
+ BantaCommentsComponent.ctorParameters = function () { return [
8585
+ { type: BantaService },
8586
+ { type: ChatBackendService }
8587
+ ]; };
8588
+ BantaCommentsComponent.propDecorators = {
8589
+ source: [{ type: core.Input }],
8590
+ fixedHeight: [{ type: core.Input }],
8591
+ maxMessages: [{ type: core.Input }],
8592
+ maxVisibleMessages: [{ type: core.Input }],
8593
+ genericAvatarUrl: [{ type: core.Input }],
8594
+ topicID: [{ type: core.Input }],
8595
+ signInLabel: [{ type: core.Input }],
8596
+ sendLabel: [{ type: core.Input }],
8597
+ permissionDeniedLabel: [{ type: core.Input }],
8598
+ signInSelected: [{ type: core.Output }],
8599
+ permissionDeniedError: [{ type: core.Output }],
8600
+ upvoted: [{ type: core.Output }],
8601
+ reported: [{ type: core.Output }],
8602
+ selected: [{ type: core.Output }],
8603
+ userSelected: [{ type: core.Output }]
8604
+ };
8578
8605
 
8579
8606
  var LiveCommentComponent = /** @class */ (function () {
8580
8607
  function LiveCommentComponent(backend) {
@@ -8587,21 +8614,21 @@
8587
8614
  get: function () {
8588
8615
  return this._upvoted;
8589
8616
  },
8590
- enumerable: true,
8617
+ enumerable: false,
8591
8618
  configurable: true
8592
8619
  });
8593
8620
  Object.defineProperty(LiveCommentComponent.prototype, "reported", {
8594
8621
  get: function () {
8595
8622
  return this._reported;
8596
8623
  },
8597
- enumerable: true,
8624
+ enumerable: false,
8598
8625
  configurable: true
8599
8626
  });
8600
8627
  Object.defineProperty(LiveCommentComponent.prototype, "selected", {
8601
8628
  get: function () {
8602
8629
  return this._selected;
8603
8630
  },
8604
- enumerable: true,
8631
+ enumerable: false,
8605
8632
  configurable: true
8606
8633
  });
8607
8634
  Object.defineProperty(LiveCommentComponent.prototype, "message", {
@@ -8623,7 +8650,7 @@
8623
8650
  this.unsubscribe = this.backend.watchMessage(value, function (message) { return _this.message = message; });
8624
8651
  }
8625
8652
  },
8626
- enumerable: true,
8653
+ enumerable: false,
8627
8654
  configurable: true
8628
8655
  });
8629
8656
  LiveCommentComponent.prototype.report = function () {
@@ -8635,39 +8662,24 @@
8635
8662
  LiveCommentComponent.prototype.select = function () {
8636
8663
  this._selected.next();
8637
8664
  };
8638
- LiveCommentComponent.ctorParameters = function () { return [
8639
- { type: ChatBackendService }
8640
- ]; };
8641
- __decorate([
8642
- core.Output(),
8643
- __metadata("design:type", rxjs.Observable),
8644
- __metadata("design:paramtypes", [])
8645
- ], LiveCommentComponent.prototype, "upvoted", null);
8646
- __decorate([
8647
- core.Output(),
8648
- __metadata("design:type", rxjs.Observable),
8649
- __metadata("design:paramtypes", [])
8650
- ], LiveCommentComponent.prototype, "reported", null);
8651
- __decorate([
8652
- core.Output(),
8653
- __metadata("design:type", rxjs.Observable),
8654
- __metadata("design:paramtypes", [])
8655
- ], LiveCommentComponent.prototype, "selected", null);
8656
- __decorate([
8657
- core.Input(),
8658
- __metadata("design:type", Object),
8659
- __metadata("design:paramtypes", [Object])
8660
- ], LiveCommentComponent.prototype, "message", null);
8661
- LiveCommentComponent = __decorate([
8662
- core.Component({
8663
- selector: 'banta-live-comment',
8664
- template: "\n <banta-comment \n *ngIf=\"message\"\n [message]=\"message\"\n (upvoted)=\"upvote()\"\n (reported)=\"report()\"\n (selected)=\"select()\"\n ></banta-comment>\n ",
8665
- styles: [""]
8666
- }),
8667
- __metadata("design:paramtypes", [ChatBackendService])
8668
- ], LiveCommentComponent);
8669
8665
  return LiveCommentComponent;
8670
- }());
8666
+ }());
8667
+ LiveCommentComponent.decorators = [
8668
+ { type: core.Component, args: [{
8669
+ selector: 'banta-live-comment',
8670
+ template: "\n <banta-comment \n *ngIf=\"message\"\n [message]=\"message\"\n (upvoted)=\"upvote()\"\n (reported)=\"report()\"\n (selected)=\"select()\"\n ></banta-comment>\n ",
8671
+ styles: [""]
8672
+ },] }
8673
+ ];
8674
+ LiveCommentComponent.ctorParameters = function () { return [
8675
+ { type: ChatBackendService }
8676
+ ]; };
8677
+ LiveCommentComponent.propDecorators = {
8678
+ upvoted: [{ type: core.Output }],
8679
+ reported: [{ type: core.Output }],
8680
+ selected: [{ type: core.Output }],
8681
+ message: [{ type: core.Input }]
8682
+ };
8671
8683
 
8672
8684
  var COMPONENTS$3 = [
8673
8685
  CommentComponent,
@@ -8678,60 +8690,81 @@
8678
8690
  var CommentsModule = /** @class */ (function () {
8679
8691
  function CommentsModule() {
8680
8692
  }
8681
- CommentsModule = __decorate([
8682
- core.NgModule({
8683
- declarations: COMPONENTS$3,
8684
- imports: [
8685
- common.CommonModule,
8686
- forms.FormsModule,
8687
- icon.MatIconModule,
8688
- button.MatButtonModule,
8689
- menu.MatMenuModule,
8690
- BantaCommonModule,
8691
- EmojiModule
8692
- ],
8693
- exports: COMPONENTS$3
8694
- })
8695
- ], CommentsModule);
8696
8693
  return CommentsModule;
8697
- }());
8694
+ }());
8695
+ CommentsModule.decorators = [
8696
+ { type: core.NgModule, args: [{
8697
+ declarations: COMPONENTS$3,
8698
+ imports: [
8699
+ common.CommonModule,
8700
+ textField.TextFieldModule,
8701
+ forms.FormsModule,
8702
+ icon.MatIconModule,
8703
+ formField.MatFormFieldModule,
8704
+ input.MatInputModule,
8705
+ button.MatButtonModule,
8706
+ menu.MatMenuModule,
8707
+ progressSpinner.MatProgressSpinnerModule,
8708
+ BantaCommonModule,
8709
+ EmojiModule
8710
+ ],
8711
+ exports: COMPONENTS$3
8712
+ },] }
8713
+ ];
8698
8714
 
8699
8715
  var BantaSdkModule = /** @class */ (function () {
8700
8716
  function BantaSdkModule() {
8701
8717
  }
8702
- BantaSdkModule = __decorate([
8703
- core.NgModule({
8704
- imports: [
8705
- common.CommonModule,
8706
- forms.FormsModule,
8707
- BantaCommonModule.forRoot(),
8708
- CommentsModule,
8709
- ChatModule,
8710
- EmojiModule,
8711
- icon.MatIconModule,
8712
- button.MatButtonModule,
8713
- tooltip.MatTooltipModule,
8714
- menu.MatMenuModule,
8715
- dialog.MatDialogModule,
8716
- formField.MatFormFieldModule,
8717
- input.MatInputModule
8718
- ],
8719
- declarations: [
8720
- BantaComponent,
8721
- BantaLogoComponent,
8722
- LiveMessageComponent
8723
- ],
8724
- exports: [
8725
- BantaComponent,
8726
- BantaLogoComponent,
8727
- LiveMessageComponent,
8728
- ChatModule,
8729
- CommentsModule
8718
+ BantaSdkModule.forRoot = function () {
8719
+ return {
8720
+ ngModule: BantaSdkModule,
8721
+ providers: [
8722
+ BantaService
8730
8723
  ]
8731
- })
8732
- ], BantaSdkModule);
8724
+ };
8725
+ };
8733
8726
  return BantaSdkModule;
8734
- }());
8727
+ }());
8728
+ BantaSdkModule.decorators = [
8729
+ { type: core.NgModule, args: [{
8730
+ imports: [
8731
+ common.CommonModule,
8732
+ forms.FormsModule,
8733
+ BantaCommonModule,
8734
+ CommentsModule,
8735
+ ChatModule,
8736
+ EmojiModule,
8737
+ icon.MatIconModule,
8738
+ button.MatButtonModule,
8739
+ tooltip.MatTooltipModule,
8740
+ menu.MatMenuModule,
8741
+ dialog.MatDialogModule,
8742
+ formField.MatFormFieldModule,
8743
+ input.MatInputModule,
8744
+ progressSpinner.MatProgressSpinnerModule
8745
+ ],
8746
+ declarations: [
8747
+ BantaComponent,
8748
+ BantaLogoComponent,
8749
+ LiveMessageComponent
8750
+ ],
8751
+ exports: [
8752
+ BantaComponent,
8753
+ BantaLogoComponent,
8754
+ LiveMessageComponent,
8755
+ ChatModule,
8756
+ CommentsModule
8757
+ ]
8758
+ },] }
8759
+ ];
8760
+
8761
+ /*
8762
+ * Public API Surface of sdk
8763
+ */
8764
+
8765
+ /**
8766
+ * Generated bundle index. Do not edit.
8767
+ */
8735
8768
 
8736
8769
  exports.BantaChatComponent = BantaChatComponent;
8737
8770
  exports.BantaCommentsComponent = BantaCommentsComponent;