@htmlbricks/hb-messages-list 0.16.68

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.
@@ -0,0 +1,183 @@
1
+ import type { CssPart, CssVar, HtmlSlot, i18nLang, StyleSetup, ComponentSetup } from "@htmlbricks/hb-jsutils/main";
2
+ import type { Component } from "../app/types/webcomponent.type";
3
+
4
+ export const storybookArgs = {
5
+ messages: { control: { type: "object" } },
6
+ authors: { control: { type: "object" } },
7
+ options: { control: { type: "object" } },
8
+ };
9
+
10
+ const cssVars: CssVar[] = [];
11
+ export const cssParts: CssPart[] = [{ name: "testpart", description: "test css part on 2 div tag" }];
12
+ export const htmlSlots: HtmlSlot[] = [{ name: "skelcontent", description: "test slot" }];
13
+ export const i18nLanguages: i18nLang[] = [];
14
+
15
+ export const styleSetup: StyleSetup = {
16
+ vars: cssVars,
17
+ parts: cssParts,
18
+ };
19
+
20
+ const defaultExampleMessages: Component["messages"] = [
21
+ {
22
+ id: "1",
23
+ text: "Hello",
24
+ timestamp: new Date(Date.now() - 36_000),
25
+ type: "text",
26
+ status: "sent",
27
+ authorId: "1",
28
+ },
29
+ {
30
+ id: "2",
31
+ text: "Hi",
32
+ timestamp: new Date(Date.now()),
33
+ type: "text",
34
+ status: "received",
35
+ authorId: "2",
36
+ },
37
+ ];
38
+ const moreExampleMessages: Component["messages"] = [
39
+ ...defaultExampleMessages,
40
+ {
41
+ id: "3",
42
+ text: "How are you?",
43
+ timestamp: new Date(Date.now()),
44
+ type: "text",
45
+ status: "received",
46
+ authorId: "2",
47
+ },
48
+ {
49
+ id: "4",
50
+ text: "I'm fine, thanks",
51
+ timestamp: new Date(Date.now()),
52
+ type: "text",
53
+ status: "sent",
54
+ authorId: "1",
55
+ },
56
+ {
57
+ id: "5",
58
+
59
+ text: "What about you?",
60
+ timestamp: new Date(Date.now()),
61
+ type: "text",
62
+ status: "received",
63
+ authorId: "2",
64
+ },
65
+ {
66
+ id: "6",
67
+ text: "I'm fine too, thanks for asking",
68
+ timestamp: new Date(Date.now()),
69
+ type: "text",
70
+ status: "sent",
71
+ authorId: "1",
72
+ },
73
+ {
74
+ id: "7",
75
+ text: "You're welcome",
76
+ timestamp: new Date(Date.now()),
77
+ type: "text",
78
+ status: "received",
79
+ authorId: "2",
80
+ },
81
+ {
82
+ id: "8",
83
+ text: "Bye",
84
+ timestamp: new Date(Date.now()),
85
+ type: "text",
86
+ status: "sent",
87
+ authorId: "1",
88
+ },
89
+ {
90
+ id: "9",
91
+ text: "Bye",
92
+ timestamp: new Date(Date.now()),
93
+ type: "text",
94
+ status: "received",
95
+ authorId: "2",
96
+ },
97
+ {
98
+ id: "10",
99
+ text: "See you later",
100
+ timestamp: new Date(Date.now()),
101
+ type: "text",
102
+ status: "sent",
103
+ authorId: "1",
104
+ },
105
+ {
106
+ id: "11",
107
+ text: "See you later",
108
+ timestamp: new Date(Date.now()),
109
+ type: "text",
110
+ status: "received",
111
+ authorId: "2",
112
+ },
113
+ {
114
+ id: "12",
115
+ text: "Bye",
116
+ timestamp: new Date(Date.now()),
117
+ type: "text",
118
+ status: "sent",
119
+ authorId: "1",
120
+ },
121
+ {
122
+ id: "13",
123
+ text: "Bye",
124
+ timestamp: new Date(Date.now()),
125
+ type: "text",
126
+ status: "received",
127
+ authorId: "2",
128
+ },
129
+ ];
130
+ const defaultExampleAuthors: Component["authors"] = [
131
+ {
132
+ id: "1",
133
+ name: "John",
134
+ avatar: "https://i.pravatar.cc/300?img=1",
135
+ status: "online",
136
+ me: true,
137
+ },
138
+ {
139
+ id: "2",
140
+ name: "Mary",
141
+ avatar: "https://i.pravatar.cc/300?img=2",
142
+ status: "online",
143
+ },
144
+ ];
145
+
146
+ const examples: { name: string; description?: string; data: Component }[] = [
147
+ {
148
+ name: "default",
149
+ data: {
150
+ messages: defaultExampleMessages,
151
+ authors: defaultExampleAuthors,
152
+ },
153
+ },
154
+
155
+ {
156
+ name: "moreMessages",
157
+ data: {
158
+ messages: moreExampleMessages,
159
+ authors: defaultExampleAuthors,
160
+ },
161
+ },
162
+ ];
163
+ export const componentSetup: ComponentSetup & { examples: { name: string; description?: string; data: Component }[] } = {
164
+ definitions: null as any,
165
+ storybookArgs,
166
+ styleSetup,
167
+ author: null as any,
168
+ contributors: [],
169
+ owner: null as any,
170
+ htmlSlots,
171
+ i18n: i18nLanguages,
172
+ examples,
173
+ screenshots: [],
174
+ licenses: [{ type: "Apache-2.0", path: "LICENSE.md", cost: 0, currency: "EUR" }],
175
+ readmePath: "README.md",
176
+ name: "hb-messages-list",
177
+ category: "basic",
178
+ tags: ["basic"],
179
+ size: {},
180
+ iifePath: "release/release.js",
181
+ repoName: "@htmlbricks/hb-messages-list",
182
+ version: null as any,
183
+ };
@@ -0,0 +1,360 @@
1
+ {
2
+ "definitions": {
3
+ "events": {
4
+ "$ref": "#/definitions/Events",
5
+ "$schema": "http://json-schema.org/draft-07/schema#",
6
+ "definitions": {
7
+ "Events": {
8
+ "additionalProperties": false,
9
+ "type": "object"
10
+ }
11
+ }
12
+ },
13
+ "component": {
14
+ "$ref": "#/definitions/Component",
15
+ "$schema": "http://json-schema.org/draft-07/schema#",
16
+ "definitions": {
17
+ "Component": {
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "authors": {
21
+ "items": {
22
+ "$ref": "#/definitions/TAuthor"
23
+ },
24
+ "type": "array"
25
+ },
26
+ "id": {
27
+ "type": "string"
28
+ },
29
+ "messages": {
30
+ "items": {
31
+ "$ref": "#/definitions/TMessage"
32
+ },
33
+ "type": "array"
34
+ },
35
+ "options": {
36
+ "additionalProperties": false,
37
+ "type": "object"
38
+ },
39
+ "style": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ "required": [
44
+ "messages",
45
+ "authors"
46
+ ],
47
+ "type": "object"
48
+ },
49
+ "TAuthor": {
50
+ "additionalProperties": false,
51
+ "properties": {
52
+ "avatar": {
53
+ "type": "string"
54
+ },
55
+ "id": {
56
+ "type": "string"
57
+ },
58
+ "me": {
59
+ "type": "boolean"
60
+ },
61
+ "name": {
62
+ "type": "string"
63
+ },
64
+ "status": {
65
+ "enum": [
66
+ "online",
67
+ "offline",
68
+ "away",
69
+ "busy"
70
+ ],
71
+ "type": "string"
72
+ }
73
+ },
74
+ "required": [
75
+ "id",
76
+ "name"
77
+ ],
78
+ "type": "object"
79
+ },
80
+ "TMessage": {
81
+ "additionalProperties": false,
82
+ "properties": {
83
+ "authorId": {
84
+ "type": "string"
85
+ },
86
+ "id": {
87
+ "type": "string"
88
+ },
89
+ "quotedMessageId": {
90
+ "type": "string"
91
+ },
92
+ "reply": {
93
+ "type": "boolean"
94
+ },
95
+ "status": {
96
+ "enum": [
97
+ "pending",
98
+ "sent",
99
+ "received",
100
+ "read"
101
+ ],
102
+ "type": "string"
103
+ },
104
+ "system": {
105
+ "type": "boolean"
106
+ },
107
+ "text": {
108
+ "type": "string"
109
+ },
110
+ "timestamp": {
111
+ "format": "date-time",
112
+ "type": "string"
113
+ },
114
+ "type": {
115
+ "enum": [
116
+ "text",
117
+ "image",
118
+ "video",
119
+ "audio",
120
+ "file"
121
+ ],
122
+ "type": "string"
123
+ },
124
+ "uri": {
125
+ "type": "string"
126
+ }
127
+ },
128
+ "required": [
129
+ "id",
130
+ "text",
131
+ "timestamp",
132
+ "type"
133
+ ],
134
+ "type": "object"
135
+ }
136
+ }
137
+ }
138
+ },
139
+ "storybookArgs": {
140
+ "messages": {
141
+ "control": {
142
+ "type": "object"
143
+ }
144
+ },
145
+ "authors": {
146
+ "control": {
147
+ "type": "object"
148
+ }
149
+ },
150
+ "options": {
151
+ "control": {
152
+ "type": "object"
153
+ }
154
+ }
155
+ },
156
+ "styleSetup": {
157
+ "vars": [],
158
+ "parts": [
159
+ {
160
+ "name": "testpart",
161
+ "description": "test css part on 2 div tag"
162
+ }
163
+ ]
164
+ },
165
+ "author": "Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",
166
+ "contributors": [],
167
+ "owner": "Dario Caruso <dev@dariocaruso.info> (https://dariocaruso.info)",
168
+ "htmlSlots": [
169
+ {
170
+ "name": "skelcontent",
171
+ "description": "test slot"
172
+ }
173
+ ],
174
+ "i18n": [],
175
+ "examples": [
176
+ {
177
+ "name": "default",
178
+ "data": {
179
+ "messages": [
180
+ {
181
+ "id": "1",
182
+ "text": "Hello",
183
+ "timestamp": "2023-01-06T16:41:46.404Z",
184
+ "type": "text",
185
+ "status": "sent",
186
+ "authorId": "1"
187
+ },
188
+ {
189
+ "id": "2",
190
+ "text": "Hi",
191
+ "timestamp": "2023-01-06T16:42:22.404Z",
192
+ "type": "text",
193
+ "status": "received",
194
+ "authorId": "2"
195
+ }
196
+ ],
197
+ "authors": [
198
+ {
199
+ "id": "1",
200
+ "name": "John",
201
+ "avatar": "https://i.pravatar.cc/300?img=1",
202
+ "status": "online",
203
+ "me": true
204
+ },
205
+ {
206
+ "id": "2",
207
+ "name": "Mary",
208
+ "avatar": "https://i.pravatar.cc/300?img=2",
209
+ "status": "online"
210
+ }
211
+ ]
212
+ }
213
+ },
214
+ {
215
+ "name": "moreMessages",
216
+ "data": {
217
+ "messages": [
218
+ {
219
+ "id": "1",
220
+ "text": "Hello",
221
+ "timestamp": "2023-01-06T16:41:46.404Z",
222
+ "type": "text",
223
+ "status": "sent",
224
+ "authorId": "1"
225
+ },
226
+ {
227
+ "id": "2",
228
+ "text": "Hi",
229
+ "timestamp": "2023-01-06T16:42:22.404Z",
230
+ "type": "text",
231
+ "status": "received",
232
+ "authorId": "2"
233
+ },
234
+ {
235
+ "id": "3",
236
+ "text": "How are you?",
237
+ "timestamp": "2023-01-06T16:42:22.404Z",
238
+ "type": "text",
239
+ "status": "received",
240
+ "authorId": "2"
241
+ },
242
+ {
243
+ "id": "4",
244
+ "text": "I'm fine, thanks",
245
+ "timestamp": "2023-01-06T16:42:22.404Z",
246
+ "type": "text",
247
+ "status": "sent",
248
+ "authorId": "1"
249
+ },
250
+ {
251
+ "id": "5",
252
+ "text": "What about you?",
253
+ "timestamp": "2023-01-06T16:42:22.404Z",
254
+ "type": "text",
255
+ "status": "received",
256
+ "authorId": "2"
257
+ },
258
+ {
259
+ "id": "6",
260
+ "text": "I'm fine too, thanks for asking",
261
+ "timestamp": "2023-01-06T16:42:22.404Z",
262
+ "type": "text",
263
+ "status": "sent",
264
+ "authorId": "1"
265
+ },
266
+ {
267
+ "id": "7",
268
+ "text": "You're welcome",
269
+ "timestamp": "2023-01-06T16:42:22.404Z",
270
+ "type": "text",
271
+ "status": "received",
272
+ "authorId": "2"
273
+ },
274
+ {
275
+ "id": "8",
276
+ "text": "Bye",
277
+ "timestamp": "2023-01-06T16:42:22.404Z",
278
+ "type": "text",
279
+ "status": "sent",
280
+ "authorId": "1"
281
+ },
282
+ {
283
+ "id": "9",
284
+ "text": "Bye",
285
+ "timestamp": "2023-01-06T16:42:22.404Z",
286
+ "type": "text",
287
+ "status": "received",
288
+ "authorId": "2"
289
+ },
290
+ {
291
+ "id": "10",
292
+ "text": "See you later",
293
+ "timestamp": "2023-01-06T16:42:22.404Z",
294
+ "type": "text",
295
+ "status": "sent",
296
+ "authorId": "1"
297
+ },
298
+ {
299
+ "id": "11",
300
+ "text": "See you later",
301
+ "timestamp": "2023-01-06T16:42:22.404Z",
302
+ "type": "text",
303
+ "status": "received",
304
+ "authorId": "2"
305
+ },
306
+ {
307
+ "id": "12",
308
+ "text": "Bye",
309
+ "timestamp": "2023-01-06T16:42:22.404Z",
310
+ "type": "text",
311
+ "status": "sent",
312
+ "authorId": "1"
313
+ },
314
+ {
315
+ "id": "13",
316
+ "text": "Bye",
317
+ "timestamp": "2023-01-06T16:42:22.404Z",
318
+ "type": "text",
319
+ "status": "received",
320
+ "authorId": "2"
321
+ }
322
+ ],
323
+ "authors": [
324
+ {
325
+ "id": "1",
326
+ "name": "John",
327
+ "avatar": "https://i.pravatar.cc/300?img=1",
328
+ "status": "online",
329
+ "me": true
330
+ },
331
+ {
332
+ "id": "2",
333
+ "name": "Mary",
334
+ "avatar": "https://i.pravatar.cc/300?img=2",
335
+ "status": "online"
336
+ }
337
+ ]
338
+ }
339
+ }
340
+ ],
341
+ "screenshots": [],
342
+ "licenses": [
343
+ {
344
+ "type": "Apache-2.0",
345
+ "path": "LICENSE.md",
346
+ "cost": 0,
347
+ "currency": "EUR"
348
+ }
349
+ ],
350
+ "readmePath": "README.md",
351
+ "name": "hb-messages-list",
352
+ "category": "basic",
353
+ "tags": [
354
+ "basic"
355
+ ],
356
+ "size": {},
357
+ "iifePath": "release/release.js",
358
+ "repoName": "@htmlbricks/hb-messages-list",
359
+ "version": "0.16.68"
360
+ }
@@ -0,0 +1,2 @@
1
+ var release=function(){"use strict";function t(){}function e(t){return t()}function o(){return Object.create(null)}function n(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let i,a;function l(t,e){return i||(i=document.createElement("a")),i.href=e,t===i.href}function c(t,e){t.appendChild(e)}function f(t,e,o){t.insertBefore(e,o||null)}function d(t){t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function g(t){return document.createTextNode(t)}function p(){return g(" ")}function m(){return g("")}function h(t,e,o){null==o?t.removeAttribute(e):t.getAttribute(e)!==o&&t.setAttribute(e,o)}function v(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function x(t){const e={};for(const o of t)e[o.name]=o.value;return e}function b(t){a=t}const y=[],$=[],w=[],k=[],_=Promise.resolve();let E=!1;function S(t){w.push(t)}const L=new Set;let D=0;function T(){const t=a;do{for(;D<y.length;){const t=y[D];D++,b(t),C(t.$$)}for(b(null),y.length=0,D=0;$.length;)$.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];L.has(e)||(L.add(e),e())}w.length=0}while(y.length);for(;k.length;)k.pop()();E=!1,L.clear(),b(t)}function C(t){if(null!==t.fragment){t.update(),n(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(S)}}const N=new Set;function O(t,e){t&&t.i&&(N.delete(t),t.i(e))}function A(t,e){t.d(1),e.delete(t.key)}function j(t,e){-1===t.$$.dirty[0]&&(y.push(t),E||(E=!0,_.then(T)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function M(s,i,l,c,f,u,g,p=[-1]){const m=a;b(s);const h=s.$$={fragment:null,ctx:null,props:u,update:t,not_equal:f,bound:o(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(i.context||(m?m.$$.context:[])),callbacks:o(),dirty:p,skip_bound:!1,root:i.target||m.$$.root};g&&g(h.root);let v=!1;if(h.ctx=l?l(s,i.props||{},((t,e,...o)=>{const n=o.length?o[0]:e;return h.ctx&&f(h.ctx[t],h.ctx[t]=n)&&(!h.skip_bound&&h.bound[t]&&h.bound[t](n),v&&j(s,t)),e})):[],h.update(),v=!0,n(h.before_update),h.fragment=!!c&&c(h.ctx),i.target){if(i.hydrate){const t=function(t){return Array.from(t.childNodes)}(i.target);h.fragment&&h.fragment.l(t),t.forEach(d)}else h.fragment&&h.fragment.c();i.intro&&O(s.$$.fragment),function(t,o,s,i){const{fragment:a,on_mount:l,on_destroy:c,after_update:f}=t.$$;a&&a.m(o,s),i||S((()=>{const o=l.map(e).filter(r);c?c.push(...o):n(o),t.$$.on_mount=[]})),f.forEach(S)}(s,i.target,i.anchor,i.customElement),T()}b(m)}let z;"function"==typeof HTMLElement&&(z=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(r);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,o){this[t]=o}disconnectedCallback(){n(this.$$.on_disconnect)}$destroy(){!function(t,e){const o=t.$$;null!==o.fragment&&(n(o.on_destroy),o.fragment&&o.fragment.d(e),o.on_destroy=o.fragment=null,o.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(e),()=>{const t=o.indexOf(e);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var P=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,I=/\n/g,R=/^\s*/,H=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,J=/^:\s*/,W=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,B=/^[;\s]*/,F=/^\s+|\s+$/g,q="";function K(t){return t?t.replace(F,q):q}var V,G=function(t,e){var o,n=null;if(!t||"string"!=typeof t)return n;for(var r,s,i=function(t,e){if("string"!=typeof t)throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var o=1,n=1;function r(t){var e=t.match(I);e&&(o+=e.length);var r=t.lastIndexOf("\n");n=~r?t.length-r:n+t.length}function s(){var t={line:o,column:n};return function(e){return e.position=new i(t),c(),e}}function i(t){this.start=t,this.end={line:o,column:n},this.source=e.source}function a(r){var s=new Error(e.source+":"+o+":"+n+": "+r);if(s.reason=r,s.filename=e.source,s.line=o,s.column=n,s.source=t,!e.silent)throw s}function l(e){var o=e.exec(t);if(o){var n=o[0];return r(n),t=t.slice(n.length),o}}function c(){l(R)}function f(t){var e;for(t=t||[];e=d();)!1!==e&&t.push(e);return t}function d(){var e=s();if("/"==t.charAt(0)&&"*"==t.charAt(1)){for(var o=2;q!=t.charAt(o)&&("*"!=t.charAt(o)||"/"!=t.charAt(o+1));)++o;if(o+=2,q===t.charAt(o-1))return a("End of comment missing");var i=t.slice(2,o-2);return n+=2,r(i),t=t.slice(o),n+=2,e({type:"comment",comment:i})}}function u(){var t=s(),e=l(H);if(e){if(d(),!l(J))return a("property missing ':'");var o=l(W),n=t({type:"declaration",property:K(e[0].replace(P,q)),value:o?K(o[0].replace(P,q)):q});return l(B),n}}return i.prototype.content=t,c(),function(){var t,e=[];for(f(e);t=u();)!1!==t&&(e.push(t),f(e));return e}()}(t),a="function"==typeof e,l=0,c=i.length;l<c;l++)r=(o=i[l]).property,s=o.value,a?e(r,s,o):s&&(n||(n={}),n[r]=s);return n};function Q(t,e,o){const n=t.slice();return n[8]=e[o],n}function U(t){let e,o,n,r,s,i,a,m,x,b,y,$,w,k,_,E,S,L,D,T,C=t[8].author.name+"",N=t[8].dateString+"",O=t[8].text+"";return{c(){e=u("div"),o=u("img"),r=p(),s=u("div"),i=u("div"),a=u("h4"),m=g(C),x=p(),b=u("h5"),y=u("i"),$=g(N),w=p(),k=u("hr"),_=p(),E=u("div"),S=g(O),L=p(),D=u("br"),T=p(),h(o,"alt",""),h(o,"class","img-circle medium-image"),l(o.src,n=t[8].author.avatar)||h(o,"src",n),h(y,"class","fa fa-clock-o"),h(i,"class","message-info"),h(E,"class","message-text"),h(s,"class","message-body"),h(e,"class","message info")},m(t,n){f(t,e,n),c(e,o),c(e,r),c(e,s),c(s,i),c(i,a),c(a,m),c(i,x),c(i,b),c(b,y),c(b,$),c(s,w),c(s,k),c(s,_),c(s,E),c(E,S),c(e,L),c(e,D),c(e,T)},p(t,e){1&e&&!l(o.src,n=t[8].author.avatar)&&h(o,"src",n),1&e&&C!==(C=t[8].author.name+"")&&v(m,C),1&e&&N!==(N=t[8].dateString+"")&&v($,N),1&e&&O!==(O=t[8].text+"")&&v(S,O)},d(t){t&&d(e)}}}function X(t){let e,o,n,r,s,i,a,m,x,b,y,$,w,k,_,E,S,L,D,T,C,N=t[8].author.name+"",O=t[8].dateString+"",A=t[8].text+"";return{c(){e=u("div"),o=u("img"),r=p(),s=u("div"),i=u("div"),a=u("div"),m=u("h4"),x=g(N),b=p(),y=u("h5"),$=u("i"),w=g(O),k=p(),_=u("hr"),E=p(),S=u("div"),L=g(A),D=p(),T=u("br"),C=p(),h(o,"alt",""),h(o,"class","img-circle medium-image"),l(o.src,n=t[8].author.avatar)||h(o,"src",n),h($,"class","fa fa-clock-o"),h(a,"class","message-info"),h(S,"class","message-text"),h(i,"class","message-body-inner"),h(s,"class","message-body"),h(e,"class","message my-message")},m(t,n){f(t,e,n),c(e,o),c(e,r),c(e,s),c(s,i),c(i,a),c(a,m),c(m,x),c(a,b),c(a,y),c(y,$),c(y,w),c(i,k),c(i,_),c(i,E),c(i,S),c(S,L),c(e,D),c(e,T),c(e,C)},p(t,e){1&e&&!l(o.src,n=t[8].author.avatar)&&h(o,"src",n),1&e&&N!==(N=t[8].author.name+"")&&v(x,N),1&e&&O!==(O=t[8].dateString+"")&&v(w,O),1&e&&A!==(A=t[8].text+"")&&v(L,A)},d(t){t&&d(e)}}}function Y(t,e){let o,n;function r(t,e){return t[8].author.me?X:U}let s=r(e),i=s(e);return{key:t,first:null,c(){o=m(),i.c(),n=m(),this.first=o},m(t,e){f(t,o,e),i.m(t,e),f(t,n,e)},p(t,o){s===(s=r(e=t))&&i?i.p(e,o):(i.d(1),i=s(e),i&&(i.c(),i.m(n.parentNode,n)))},d(t){t&&d(o),i.d(t),t&&d(n)}}}function Z(e){let o,n=[],r=new Map,s=e[0];const i=t=>t[8].id;for(let t=0;t<s.length;t+=1){let o=Q(e,s,t),a=i(o);r.set(a,n[t]=Y(a,o))}return{c(){for(let t=0;t<n.length;t+=1)n[t].c();o=m(),this.c=t},m(t,e){for(let o=0;o<n.length;o+=1)n[o].m(t,e);f(t,o,e)},p(t,[e]){1&e&&(s=t[0],n=function(t,e,o,n,r,s,i,a,l,c,f,d){let u=t.length,g=s.length,p=u;const m={};for(;p--;)m[t[p].key]=p;const h=[],v=new Map,x=new Map;for(p=g;p--;){const t=d(r,s,p),a=o(t);let l=i.get(a);l?n&&l.p(t,e):(l=c(a,t),l.c()),v.set(a,h[p]=l),a in m&&x.set(a,Math.abs(p-m[a]))}const b=new Set,y=new Set;function $(t){O(t,1),t.m(a,f),i.set(t.key,t),f=t.first,g--}for(;u&&g;){const e=h[g-1],o=t[u-1],n=e.key,r=o.key;e===o?(f=e.first,u--,g--):v.has(r)?!i.has(n)||b.has(n)?$(e):y.has(r)?u--:x.get(n)>x.get(r)?(y.add(n),$(e)):(b.add(r),u--):(l(o,i),u--)}for(;u--;){const e=t[u];v.has(e.key)||l(e,i)}for(;g;)$(h[g-1]);return h}(n,e,i,1,t,s,r,o.parentNode,A,Y,o,Q))},i:t,o:t,d(t){for(let e=0;e<n.length;e+=1)n[e].d(t);t&&d(o)}}}function tt(t,e,o){let{id:n}=e,{style:r}=e,{messages:s}=e,{authors:i}=e,{options:a}=e,l=[];const c={};return t.$$set=t=>{"id"in t&&o(1,n=t.id),"style"in t&&o(5,r=t.style),"messages"in t&&o(2,s=t.messages),"authors"in t&&o(3,i=t.authors),"options"in t&&o(4,a=t.options)},t.$$.update=()=>{if(63&t.$$.dirty){if(n||o(1,n=""),r&&G(r),"string"==typeof a)try{o(4,a=JSON.parse(a))}catch(t){console.error("error parsing options",t)}if(a||o(4,a=c),"string"==typeof s)try{o(2,s=JSON.parse(s))}catch(t){console.error("error parsing messages",t)}if("string"==typeof i)try{o(3,i=JSON.parse(i))}catch(t){console.error("error parsing authors",t)}if((null==s?void 0:s.length)&&(null==i?void 0:i.length)){console.log("reload messages");const t=[];for(const e of s){const o=i.find((t=>t.id===e.authorId));if(o){const n=new Date(e.timestamp).toDateString()===(new Date).toDateString(),r=new Date(e.timestamp),s=r.toLocaleTimeString().split(":")[0]+":"+r.toLocaleTimeString().split(":")[1],i=r.toLocaleString().split(" ")[0]+" "+r.toLocaleTimeString().split(":")[0]+":"+r.toLocaleTimeString().split(":")[1],a=n?s:i;t.push(Object.assign(Object.assign({},e),{author:o,dateString:a}))}}o(0,l=t)}console.info("messages are",l)}},[l,n,s,i,a,r]}(function(t,e){e.__esModule=!0,e.LanguageTranslator=e.addComponent=e.getChildStyleToPass=void 0,e.getChildStyleToPass=function(t,e){var o,n,r="";if(t&&(null==e?void 0:e.length)&&(null===(o=Object.keys(t))||void 0===o?void 0:o.length)&&(null===(n=null==e?void 0:e.filter((function(e){return Object.keys(t).includes(e.name)})))||void 0===n?void 0:n.length))for(var s=function(o){(null==e?void 0:e.filter((function(e){return e.name===o&&e.defaultValue!==t[o]})))&&(r+="".concat(o,":").concat(t[o],";"))},i=0,a=Object.keys(t);i<a.length;i++)s(a[i]);return r},e.addComponent=function(t){var e,o=(null===(e=null==t?void 0:t.repoName.split("/"))||void 0===e?void 0:e[1])||(null==t?void 0:t.repoName);if(!o)throw new Error("wrong componentPath "+(null==t?void 0:t.repoName));if(!(null==t?void 0:t.version))throw new Error("wrong version "+(null==t?void 0:t.version));var n=(null==t?void 0:t.iifePath)||"release/release.js";if(!document.getElementById(o+"-script"))try{var r=document.createElement("script");r.id=o+"-script",r.src="https://cdn.jsdelivr.net/npm/".concat(t.repoName,"@").concat(t.version,"/").concat(n),(null==t?void 0:t.local)&&location.href.includes("localhost")&&(r.src="".concat(t.local)),document.head.appendChild(r)}catch(t){console.warn(t)}};var o=function(){function t(t){if(!(null==t?void 0:t.dictionary))throw new Error("no dictionary provided");this.dictionary=t.dictionary,this.setLang(null==t?void 0:t.lang)}return t.prototype.setLang=function(e){e||(e=t.getDefaultLang()),this.lang=e},t.prototype.translateWord=function(e,o){return t.getDictionaryWord(e,this.dictionary,o||this.lang)},t.prototype.translateDate=function(e,o,n){return t.formatDate(e,o,n||this.lang)},t.getDefaultLang=function(){var t,e,o,n,r,s="en";return(null===navigator||void 0===navigator?void 0:navigator.languages)&&(null===(o=null===(e=null===(t=navigator.languages[0])||void 0===t?void 0:t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||void 0===o?void 0:o.length)&&(s=null===(r=null===(n=navigator.languages[0])||void 0===n?void 0:n.split("-")[0])||void 0===r?void 0:r.toLowerCase()),s},t.getDictionaryWord=function(e,o,n){var r;if(!e)throw new Error("no wordKey provided");if(!o)throw new Error("no dictionary provided");if(n&&(null===(r=o[n])||void 0===r?void 0:r[e]))return o[n][e];var s="",i=t.getDefaultLang();if(!n||i!==n){var a=null==o?void 0:o[i];(null==a?void 0:a[e])&&(s=a[e])}return s},t.formatDate=function(e,o,n){if(!e)throw new Error("no date provided");if("function"!=typeof e.getMonth)throw new Error("wrong date format");return new Intl.DateTimeFormat(n||t.getDefaultLang(),o).format(e)},t}();e.LanguageTranslator=o})(V={exports:{}},V.exports);class et extends z{constructor(t){super(),this.shadowRoot.innerHTML='<style>@import url("https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap");:host{font-family:"Roboto", sans-serif;width:100%;background-color:#fbfcff;max-height:100%;position:absolute;padding-top:20px}.medium-image{width:45px;height:45px;margin-right:5px}.img-circle{border-radius:50%}.message-body{background-color:#fbfcff;height:100%;width:calc(100% - 305px);float:right}.message{position:relative;width:100%}.message br{clear:both}.message .message-body{position:relative;width:auto;max-width:calc(100% - 150px);float:left;background-color:#fff;border-radius:4px;border:1px solid #dbe3e8;margin:0 5px 20px 15px;color:#788288;overflow-x:hidden}.message:after{content:"";position:absolute;top:11px;left:63px;float:left;z-index:100;border-top:10px solid transparent;border-left:none;border-bottom:10px solid transparent;border-right:13px solid #fff}.message:before{content:"";position:absolute;top:10px;left:62px;float:left;z-index:99;border-top:11px solid transparent;border-left:none;border-bottom:11px solid transparent;border-right:13px solid #dbe3e8}.message .medium-image{float:left;margin-left:10px}.message .message-info{width:100%;height:22px}.message .message-info>h5>i{font-size:11px;font-weight:700;margin:0 2px 0 0;color:#a2b8c5}.message .message-info>h5{color:#a2b8c5;margin:8px 0 0 0;font-size:12px;float:right;padding-right:10px}.message .message-info>h4{font-size:14px;font-weight:600;margin:7px 13px 0 10px;color:#65addd;float:left}.message hr{margin:4px 2%;width:96%;opacity:0.75}.message .message-text{text-align:left;padding:3px 13px 10px 13px;font-size:14px}.message.my-message .message-body{float:right;margin:0 15px 20px 5px}.message.my-message:after{content:"";position:absolute;top:11px;left:auto;right:63px;float:left;z-index:100;border-top:10px solid transparent;border-left:13px solid #fff;border-bottom:10px solid transparent;border-right:none}.message.my-message:before{content:"";position:absolute;top:10px;left:auto;right:62px;float:left;z-index:99;border-top:11px solid transparent;border-left:13px solid #dbe3e8;border-bottom:11px solid transparent;border-right:none}.message.my-message .medium-image{float:right;margin-left:5px;margin-right:10px}.message.my-message .message-info>h5{float:left;padding-left:10px;padding-right:0}.message.my-message .message-info>h4{float:right}.message.info .message-body{background-color:#2da9e9;border:1px solid #2da9e9;color:#fff}.message.info:after,.message.info:before{border-right:13px solid #2da9e9}.message.info .message-info>h4{color:#fff}.message.info .message-info>h5,.message.info .message-info>h5>i{color:#fff;opacity:0.9}@media screen and (max-width: 767px){.message-body{width:100%;margin:20px 0;border:1px solid #dce2e9;background-color:#fff}.message .message-body{max-width:calc(100% - 85px)}}</style>',M(this,{target:this.shadowRoot,props:x(this.attributes),customElement:!0},tt,Z,s,{id:1,style:5,messages:2,authors:3,options:4},null),t&&(t.target&&f(t.target,this,t.anchor),t.props&&(this.$set(t.props),T()))}static get observedAttributes(){return["id","style","messages","authors","options"]}get id(){return this.$$.ctx[1]}set id(t){this.$$set({id:t}),T()}get style(){return this.$$.ctx[5]}set style(t){this.$$set({style:t}),T()}get messages(){return this.$$.ctx[2]}set messages(t){this.$$set({messages:t}),T()}get authors(){return this.$$.ctx[3]}set authors(t){this.$$set({authors:t}),T()}get options(){return this.$$.ctx[4]}set options(t){this.$$set({options:t}),T()}}return customElements.define("hb-messages-list",et),et}();
2
+ //# sourceMappingURL=release.js.map