@everymatrix/lottery-hakuna-ticket-history 0.0.23 → 0.0.24

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 (29) hide show
  1. package/dist/cjs/index-62b3d460.js +64 -0
  2. package/dist/cjs/index-dc95b9af.js +6 -2
  3. package/dist/cjs/index.cjs.js +2 -1
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{lottery-button_8.cjs.entry.js → lottery-button_7.cjs.entry.js} +98 -268
  6. package/dist/cjs/{lottery-hakuna-ticket-history-ec8bf5d5.js → lottery-hakuna-ticket-history-49bed503.js} +51 -124
  7. package/dist/cjs/lottery-hakuna-ticket-history.cjs.js +1 -1
  8. package/dist/cjs/lottery-infinite-scroll.cjs.entry.js +223 -0
  9. package/dist/collection/components/lottery-hakuna-ticket-history/lottery-hakuna-ticket-history.css +8 -0
  10. package/dist/collection/components/lottery-hakuna-ticket-history/lottery-hakuna-ticket-history.js +51 -8
  11. package/dist/collection/components/lottery-infinite-scroll/lottery-infinite-scroll.js +4 -4
  12. package/dist/esm/index-30f31c84.js +60 -0
  13. package/dist/esm/index-50addd47.js +6 -2
  14. package/dist/esm/index.js +2 -1
  15. package/dist/esm/loader.js +1 -1
  16. package/dist/esm/{lottery-button_8.entry.js → lottery-button_7.entry.js} +71 -241
  17. package/dist/esm/{lottery-hakuna-ticket-history-35d86d50.js → lottery-hakuna-ticket-history-844d94d7.js} +46 -115
  18. package/dist/esm/lottery-hakuna-ticket-history.js +1 -1
  19. package/dist/esm/lottery-infinite-scroll.entry.js +219 -0
  20. package/dist/lottery-hakuna-ticket-history/index-30f31c84.js +1 -0
  21. package/dist/lottery-hakuna-ticket-history/index.esm.js +1 -1
  22. package/dist/lottery-hakuna-ticket-history/lottery-button_7.entry.js +1 -0
  23. package/dist/lottery-hakuna-ticket-history/lottery-hakuna-ticket-history-844d94d7.js +1 -0
  24. package/dist/lottery-hakuna-ticket-history/lottery-hakuna-ticket-history.esm.js +1 -1
  25. package/dist/lottery-hakuna-ticket-history/lottery-infinite-scroll.entry.js +1 -0
  26. package/dist/types/components/lottery-hakuna-ticket-history/lottery-hakuna-ticket-history.d.ts +5 -0
  27. package/package.json +1 -1
  28. package/dist/lottery-hakuna-ticket-history/lottery-button_8.entry.js +0 -1
  29. package/dist/lottery-hakuna-ticket-history/lottery-hakuna-ticket-history-35d86d50.js +0 -1
@@ -3,15 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-dc95b9af.js');
6
- const lotteryHakunaTicketHistory = require('./lottery-hakuna-ticket-history-ec8bf5d5.js');
6
+ const index$1 = require('./index-62b3d460.js');
7
+ const lotteryHakunaTicketHistory = require('./lottery-hakuna-ticket-history-49bed503.js');
7
8
 
8
- // This icon file is generated automatically.
9
- var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
10
- const DeleteFilled$1 = DeleteFilled;
11
-
12
- const DEFAULT_LANGUAGE$4 = 'en';
13
- const SUPPORTED_LANGUAGES$4 = ['ro', 'en', 'fr', 'ar', 'hr', 'zh'];
14
- const TRANSLATIONS$4 = {
9
+ const DEFAULT_LANGUAGE$3 = 'en';
10
+ const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr', 'zh'];
11
+ const TRANSLATIONS$3 = {
15
12
  en: {
16
13
  loading: 'Loading'
17
14
  },
@@ -20,9 +17,9 @@ const TRANSLATIONS$4 = {
20
17
  ar: {},
21
18
  hr: {}
22
19
  };
23
- const translate$4 = (key, customLang, replacements) => {
20
+ const translate$3 = (key, customLang, replacements) => {
24
21
  const lang = customLang;
25
- let translation = TRANSLATIONS$4[lang !== undefined && SUPPORTED_LANGUAGES$4.includes(lang) ? lang : DEFAULT_LANGUAGE$4][key];
22
+ let translation = TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
26
23
  if (replacements) {
27
24
  Object.keys(replacements).forEach((placeholder) => {
28
25
  translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
@@ -30,14 +27,14 @@ const translate$4 = (key, customLang, replacements) => {
30
27
  }
31
28
  return translation;
32
29
  };
33
- const getTranslations$4 = (data) => {
30
+ const getTranslations$3 = (data) => {
34
31
  Object.keys(data).forEach((item) => {
35
32
  for (let key in data[item]) {
36
- TRANSLATIONS$4[item][key] = data[item][key];
33
+ TRANSLATIONS$3[item][key] = data[item][key];
37
34
  }
38
35
  });
39
36
  };
40
- const resolveTranslationUrl$3 = async (translationUrl) => {
37
+ const resolveTranslationUrl$2 = async (translationUrl) => {
41
38
  if (translationUrl) {
42
39
  try {
43
40
  const response = await fetch(translationUrl);
@@ -45,7 +42,7 @@ const resolveTranslationUrl$3 = async (translationUrl) => {
45
42
  throw new Error(`HTTP error! status: ${response.status}`);
46
43
  }
47
44
  const translations = await response.json();
48
- getTranslations$4(translations);
45
+ getTranslations$3(translations);
49
46
  }
50
47
  catch (error) {
51
48
  console.error('Failed to fetch or parse translations from URL:', error);
@@ -95,17 +92,17 @@ const LotteryButton = class {
95
92
  }
96
93
  handleClientStylingChange(newValue, oldValue) {
97
94
  if (newValue != oldValue) {
98
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
95
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
99
96
  }
100
97
  }
101
98
  handleClientStylingUrlChange(newValue, oldValue) {
102
99
  if (newValue != oldValue) {
103
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
100
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
104
101
  }
105
102
  }
106
103
  handleMbSourceChange(newValue, oldValue) {
107
104
  if (newValue != oldValue) {
108
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
105
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
109
106
  }
110
107
  }
111
108
  disconnectedCallback() {
@@ -114,16 +111,16 @@ const LotteryButton = class {
114
111
  componentDidLoad() {
115
112
  if (this.stylingContainer) {
116
113
  if (this.mbSource)
117
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
114
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
118
115
  if (this.clientStyling)
119
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
116
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
120
117
  if (this.clientStylingUrl)
121
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
118
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
122
119
  }
123
120
  }
124
121
  componentWillLoad() {
125
122
  if (this.translationUrl) {
126
- resolveTranslationUrl$3(this.translationUrl);
123
+ resolveTranslationUrl$2(this.translationUrl);
127
124
  }
128
125
  }
129
126
  render() {
@@ -163,7 +160,7 @@ const LotteryButton = class {
163
160
  [`btn--${variant}`]: true,
164
161
  [`btn--${size}`]: true,
165
162
  'btn--loading': this.loading
166
- }, style: color ? buttonStyles : undefined, disabled: isDisabled, onClick: this.handleClick, ref: (el) => (this.stylingContainer = el) }, this.loading ? (index.h("div", { class: "loading-container" }, index.h("span", { class: "content" }, this.text || translate$4('loading', this.language)), index.h("span", { class: "spinner" }))) : (index.h("span", { class: "content" }, index.h("slot", { name: "icon-left" }), this.text || index.h("slot", null), index.h("slot", { name: "icon-right" }))), index.h("div", { key: '302ea02be395bb24989d4abc040a513e23fa029a', class: "ripple-container" }, this.ripples.map((ripple, index$1) => (index.h("span", { key: index$1, class: "ripple", style: {
163
+ }, style: color ? buttonStyles : undefined, disabled: isDisabled, onClick: this.handleClick, ref: (el) => (this.stylingContainer = el) }, this.loading ? (index.h("div", { class: "loading-container" }, index.h("span", { class: "content" }, this.text || translate$3('loading', this.language)), index.h("span", { class: "spinner" }))) : (index.h("span", { class: "content" }, index.h("slot", { name: "icon-left" }), this.text || index.h("slot", null), index.h("slot", { name: "icon-right" }))), index.h("div", { key: '302ea02be395bb24989d4abc040a513e23fa029a', class: "ripple-container" }, this.ripples.map((ripple, index$1) => (index.h("span", { key: index$1, class: "ripple", style: {
167
164
  top: `${ripple.top}px`,
168
165
  left: `${ripple.left}px`,
169
166
  width: `${ripple.size}px`,
@@ -179,16 +176,16 @@ const LotteryButton = class {
179
176
  };
180
177
  LotteryButton.style = LotteryButtonStyle0;
181
178
 
182
- const DEFAULT_LANGUAGE$3 = 'en';
183
- const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr'];
184
- const TRANSLATIONS$3 = {
179
+ const DEFAULT_LANGUAGE$2 = 'en';
180
+ const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'fr', 'ar', 'hr'];
181
+ const TRANSLATIONS$2 = {
185
182
  en: {
186
183
  total: 'Total:',
187
184
  },
188
185
  };
189
- const translate$3 = (key, customLang, replacements) => {
186
+ const translate$2 = (key, customLang, replacements) => {
190
187
  const lang = customLang;
191
- let translation = TRANSLATIONS$3[lang !== undefined && SUPPORTED_LANGUAGES$3.includes(lang) ? lang : DEFAULT_LANGUAGE$3][key];
188
+ let translation = TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
192
189
  if (replacements) {
193
190
  Object.keys(replacements).forEach((placeholder) => {
194
191
  translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
@@ -196,14 +193,14 @@ const translate$3 = (key, customLang, replacements) => {
196
193
  }
197
194
  return translation;
198
195
  };
199
- const getTranslations$3 = (data) => {
196
+ const getTranslations$2 = (data) => {
200
197
  Object.keys(data).forEach((item) => {
201
198
  for (let key in data[item]) {
202
- TRANSLATIONS$3[item][key] = data[item][key];
199
+ TRANSLATIONS$2[item][key] = data[item][key];
203
200
  }
204
201
  });
205
202
  };
206
- const resolveTranslationUrl$2 = async (translationUrl) => {
203
+ const resolveTranslationUrl$1 = async (translationUrl) => {
207
204
  if (translationUrl) {
208
205
  try {
209
206
  const response = await fetch(translationUrl);
@@ -211,7 +208,7 @@ const resolveTranslationUrl$2 = async (translationUrl) => {
211
208
  throw new Error(`HTTP error! status: ${response.status}`);
212
209
  }
213
210
  const translations = await response.json();
214
- getTranslations$3(translations);
211
+ getTranslations$2(translations);
215
212
  }
216
213
  catch (error) {
217
214
  console.error('Failed to fetch or parse translations from URL:', error);
@@ -256,7 +253,7 @@ const LotteryHakunaTicketHistoryItem = class {
256
253
  return (index.h("div", { class: "lottery-hakuna-ticket-history-item__container" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__top" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__country-wrapper" }, index.h("ui-skeleton", { structure: "image", width: "30px", height: "20px" }), index.h("ui-skeleton", { structure: "title", width: "86px", height: "17px", marginBottom: 0 })), index.h("div", { class: "lottery-hakuna-ticket-history-item__details" }, index.h("ui-skeleton", { structure: "text", width: "60%", height: "20px" }))), index.h("div", { class: "lottery-hakuna-ticket-history-item__bottom" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__numbers-wrapper" }, new Array(this.selectedNumbersCount).fill(index.h("ui-skeleton", { borderRadius: "8px", structure: "rectangle", width: "24px", height: "24px" }))), index.h("div", { class: "lottery-hakuna-ticket-history-item__date-wrapper" }, index.h("ui-skeleton", { structure: "text", width: "180px", height: "14px" })))));
257
254
  };
258
255
  this.renderMain = () => {
259
- return (index.h("div", { class: "lottery-hakuna-ticket-history-item__container" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__top" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__country-wrapper" }, this.historyItemImageSrc && (index.h("img", { src: this.historyItemImageSrc, alt: this.historyItemName, class: "lottery-hakuna-ticket-history-item__country-flag" })), index.h("span", { class: "lottery-hakuna-ticket-history-item__country-name" }, this.historyItemName)), index.h("div", { class: "lottery-hakuna-ticket-history-item__details" }, index.h("span", { class: "lottery-hakuna-ticket-history-item__meta" }, translate$3('total', this.language), index.h("span", { class: "lottery-hakuna-ticket-history-item__meta-value" }, this.totalAmount)))), index.h("div", { class: "lottery-hakuna-ticket-history-item__bottom" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__numbers-wrapper" }, this.selectedNumbers && (index.h("lottery-selection-group", { type: "preview", bulletTexts: this.selectedNumbers, clientStyling: this.selectionGroupStyle + (this.clientStyling || ''), clientStylingUrl: this.clientStylingUrl, mbSource: this.mbSource, hasBorder: true, hasBackground: false, selectionGroupId: this.ticketId ? this.ticketId.toString() : undefined }))), index.h("div", { class: "lottery-hakuna-ticket-history-item__date-wrapper" }, this.date && index.h("div", null, this.date), this.time && index.h("div", null, this.time)))));
256
+ return (index.h("div", { class: "lottery-hakuna-ticket-history-item__container" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__top" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__country-wrapper" }, this.historyItemImageSrc && (index.h("img", { src: this.historyItemImageSrc, alt: this.historyItemName, class: "lottery-hakuna-ticket-history-item__country-flag" })), index.h("span", { class: "lottery-hakuna-ticket-history-item__country-name" }, this.historyItemName)), index.h("div", { class: "lottery-hakuna-ticket-history-item__details" }, index.h("span", { class: "lottery-hakuna-ticket-history-item__meta" }, translate$2('total', this.language), index.h("span", { class: "lottery-hakuna-ticket-history-item__meta-value" }, this.totalAmount)))), index.h("div", { class: "lottery-hakuna-ticket-history-item__bottom" }, index.h("div", { class: "lottery-hakuna-ticket-history-item__numbers-wrapper" }, this.selectedNumbers && (index.h("lottery-selection-group", { type: "preview", bulletTexts: this.selectedNumbers, clientStyling: this.selectionGroupStyle + (this.clientStyling || ''), clientStylingUrl: this.clientStylingUrl, mbSource: this.mbSource, hasBorder: true, hasBackground: false, selectionGroupId: this.ticketId ? this.ticketId.toString() : undefined }))), index.h("div", { class: "lottery-hakuna-ticket-history-item__date-wrapper" }, this.date && index.h("div", null, this.date), this.time && index.h("div", null, this.time)))));
260
257
  };
261
258
  this.mbSource = undefined;
262
259
  this.clientStyling = undefined;
@@ -275,30 +272,30 @@ const LotteryHakunaTicketHistoryItem = class {
275
272
  }
276
273
  handleClientStylingChange(newValue, oldValue) {
277
274
  if (newValue != oldValue) {
278
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
275
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
279
276
  }
280
277
  }
281
278
  handleClientStylingUrlChange(newValue, oldValue) {
282
279
  if (newValue != oldValue) {
283
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
280
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
284
281
  }
285
282
  }
286
283
  handleMbSourceChange(newValue, oldValue) {
287
284
  if (newValue != oldValue) {
288
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
285
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
289
286
  }
290
287
  }
291
288
  async componentWillLoad() {
292
- resolveTranslationUrl$2(this.translationUrl);
289
+ resolveTranslationUrl$1(this.translationUrl);
293
290
  }
294
291
  componentDidLoad() {
295
292
  if (this.stylingContainer) {
296
293
  if (this.mbSource)
297
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
294
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
298
295
  if (this.clientStyling)
299
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
296
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
300
297
  if (this.clientStylingUrl)
301
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
298
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
302
299
  }
303
300
  }
304
301
  disconnectedCallback() {
@@ -315,220 +312,54 @@ const LotteryHakunaTicketHistoryItem = class {
315
312
  };
316
313
  LotteryHakunaTicketHistoryItem.style = LotteryHakunaTicketHistoryItemStyle0;
317
314
 
318
- const DEFAULT_LANGUAGE$2 = 'en';
319
- const SUPPORTED_LANGUAGES$2 = ['ro', 'en', 'fr', 'ar', 'hr'];
320
- const TRANSLATIONS$2 = {
321
- en: {
322
- noMoreData: 'No more data',
323
- loading: 'Loading...',
324
- release: 'Release',
325
- refreshing: 'Refreshing...',
326
- pull: 'Pull'
327
- }
328
- };
329
- const translate$2 = (key, customLang, replacements) => {
330
- const lang = customLang;
331
- let translation = TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
332
- if (replacements) {
333
- Object.keys(replacements).forEach((placeholder) => {
334
- translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
335
- });
336
- }
337
- return translation;
338
- };
339
- const getTranslations$2 = (data) => {
340
- Object.keys(data).forEach((item) => {
341
- for (let key in data[item]) {
342
- TRANSLATIONS$2[item][key] = data[item][key];
343
- }
344
- });
345
- };
346
- const resolveTranslationUrl$1 = async (translationUrl) => {
347
- if (translationUrl) {
348
- try {
349
- const response = await fetch(translationUrl);
350
- if (!response.ok) {
351
- throw new Error(`HTTP error! status: ${response.status}`);
352
- }
353
- const translations = await response.json();
354
- getTranslations$2(translations);
355
- }
356
- catch (error) {
357
- console.error('Failed to fetch or parse translations from URL:', error);
358
- }
359
- }
360
- };
361
-
362
- const lotteryInfiniteScrollCss = ":host{display:block;width:100%}.lottery-infinite-scroll__container{display:block;width:100%;overflow-x:hidden;-webkit-overflow-scrolling:touch;padding-right:10px;box-sizing:border-box;scrollbar-width:thin;scrollbar-color:var(--emw-hakuna-bg-secondary, #120505) var(--lottery-infinite-scroll-scrollbar-track-background, transparent);}.lottery-infinite-scroll__container::-webkit-scrollbar{width:var(--lottery-infinite-scroll-scrollbar-width, 2px)}.lottery-infinite-scroll__container::-webkit-scrollbar-track{background:var(--lottery-infinite-scroll-scrollbar-track-background, transparent)}.lottery-infinite-scroll__container::-webkit-scrollbar-thumb{background:var(--emw-hakuna-bg-secondary, #120505);border-radius:var(--lottery-infinite-scroll-scrollbar-thumb-border-radius, 2px)}.lottery-infinite-scroll__sentinel{width:100%;display:block;text-align:center;}.lottery-infinite-scroll__sentinel.virtual-scroll-sentinel{height:1px;pointer-events:none;opacity:0;position:absolute;width:100%}.lottery-infinite-scroll__sentinel:not(.virtual-scroll-sentinel){height:1px;}.lottery-infinite-scroll__end-message{width:100%;display:block;text-align:center;}.lottery-infinite-scroll__end-message.virtual-scroll-end-message{position:absolute;width:100%}.ptr-indicator{height:var(--pull-trigger-distance, 60px);margin-top:calc(-1 * var(--pull-trigger-distance, 60px));display:flex;align-items:center;justify-content:center;position:absolute;top:0;width:100%;z-index:10;font-size:14px;color:#666;}";
363
- const LotteryInfiniteScrollStyle0 = lotteryInfiniteScrollCss;
315
+ // This icon file is generated automatically.
316
+ var DeleteFilled = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z" } }] }, "name": "delete", "theme": "filled" };
317
+ const DeleteFilled$1 = DeleteFilled;
364
318
 
365
- const LotteryInfiniteScroll = class {
366
- constructor(hostRef) {
367
- index.registerInstance(this, hostRef);
368
- this.loadMore = index.createEvent(this, "loadMore", 7);
369
- this.refresh = index.createEvent(this, "refresh", 7);
370
- // Touch event vars
371
- this.startY = 0;
372
- this.isTouching = false;
373
- // --- Pull to Refresh Logic (Touch handling) ---
374
- this.handleTouchStart = (e) => {
375
- // Only allow pull-down when scrollbar is at the top
376
- if (this.scrollContainer.scrollTop <= 0) {
377
- this.startY = e.touches[0].clientY;
378
- this.isTouching = true;
379
- }
380
- };
381
- this.handleTouchMove = (e) => {
382
- if (!this.isTouching || this.isRefreshing)
383
- return;
384
- const currentY = e.touches[0].clientY;
385
- const distance = currentY - this.startY;
386
- // Only process pull-down and when scrollbar is at the top
387
- if (distance > 0 && this.scrollContainer.scrollTop <= 0) {
388
- // Prevent default scroll behavior (prevents entire page from being dragged)
389
- if (e.cancelable)
390
- e.preventDefault();
391
- // Add damping effect (harder to pull further)
392
- this.pullDistance = Math.pow(distance, 0.8);
393
- }
394
- else {
395
- // If user pushes up, or already scrolled, reset
396
- this.isTouching = false;
397
- this.pullDistance = 0;
398
- }
399
- };
400
- this.handleTouchEnd = () => {
401
- this.isTouching = false;
402
- if (this.pullDistance >= this.pullTriggerDistance) {
403
- // Trigger refresh
404
- this.pullDistance = this.pullTriggerDistance; // Stay in loading area
405
- this.refresh.emit();
406
- }
407
- else {
408
- // Not reached threshold, bounce back
409
- this.pullDistance = 0;
410
- }
411
- };
412
- this.mbSource = undefined;
413
- this.clientStyling = undefined;
414
- this.clientStylingUrl = undefined;
415
- this.language = 'en';
416
- this.translationUrl = '';
417
- this.items = [];
418
- this.hasMore = false;
419
- this.isLoading = false;
420
- this.isRefreshing = false;
421
- this.threshold = '0px 0px 200px 0px';
422
- this.containerHeight = '100%';
423
- this.renderItem = undefined;
424
- this.renderSkeleton = undefined;
425
- this.skeletonCount = 6;
426
- this.pullTriggerDistance = 60;
427
- this.minItemWidth = 340;
428
- this.gridGap = 10;
429
- this.pullDistance = 0;
430
- }
431
- componentDidLoad() {
432
- this.initObserver();
433
- if (this.scrollContainer) {
434
- if (this.mbSource)
435
- lotteryHakunaTicketHistory.setStreamStyling(this.scrollContainer, `${this.mbSource}.Style`);
436
- if (this.clientStyling)
437
- lotteryHakunaTicketHistory.setClientStyling(this.scrollContainer, this.clientStyling);
438
- if (this.clientStylingUrl)
439
- lotteryHakunaTicketHistory.setClientStylingURL(this.scrollContainer, this.clientStylingUrl);
440
- }
441
- }
442
- handleClientStylingChange(newValue, oldValue) {
443
- if (newValue != oldValue) {
444
- lotteryHakunaTicketHistory.setClientStyling(this.scrollContainer, this.clientStyling);
445
- }
446
- }
447
- handleClientStylingUrlChange(newValue, oldValue) {
448
- if (newValue != oldValue) {
449
- lotteryHakunaTicketHistory.setClientStylingURL(this.scrollContainer, this.clientStylingUrl);
450
- }
451
- }
452
- handleMbSourceChange(newValue, oldValue) {
453
- if (newValue != oldValue) {
454
- lotteryHakunaTicketHistory.setStreamStyling(this.scrollContainer, `${this.mbSource}.Style`);
455
- }
456
- }
457
- componentWillLoad() {
458
- resolveTranslationUrl$1(this.translationUrl);
459
- }
460
- componentDidUpdate() {
461
- if (this.hasMore && !this.isLoading) {
462
- this.initObserver();
463
- }
464
- }
465
- disconnectedCallback() {
466
- this.disconnectObserver();
467
- this.stylingSubscription && this.stylingSubscription.unsubscribe();
468
- }
469
- handleRefreshingChange(newValue) {
470
- if (!newValue) {
471
- this.pullDistance = 0;
472
- }
473
- }
474
- disconnectObserver() {
475
- if (this.observer) {
476
- this.observer.disconnect();
477
- this.observer = null;
478
- }
479
- }
480
- initObserver() {
481
- this.disconnectObserver();
482
- if (!this.hasMore || this.isLoading || !this.sentinel)
483
- return;
484
- const options = {
485
- root: this.scrollContainer,
486
- rootMargin: this.threshold,
487
- threshold: 0.1
488
- };
489
- this.observer = new IntersectionObserver((entries) => {
490
- if (entries[0].isIntersecting && this.hasMore && !this.isLoading) {
491
- this.loadMore.emit();
492
- }
493
- }, options);
494
- this.observer.observe(this.sentinel);
495
- }
496
- render() {
497
- const { items, minItemWidth, gridGap } = this;
498
- const showSkeleton = items.length === 0 && !!this.renderSkeleton && this.isLoading;
499
- const listToRender = showSkeleton ? new Array(this.skeletonCount).fill(null) : items;
500
- const contentTransform = {
501
- transform: `translateY(${this.pullDistance}px)`,
502
- transition: this.isTouching ? 'none' : 'transform 0.3s ease-out'
503
- };
504
- const listStyle = {
505
- display: 'grid',
506
- gridTemplateColumns: `repeat(auto-fill, minmax(${minItemWidth}px, 1fr))`,
507
- gap: `${gridGap}px`,
508
- boxSizing: 'border-box'
509
- };
510
- return (index.h("div", { key: '5f9372a0c2d0cdf00685cbedf062fb333d1e5348', class: "lottery-infinite-scroll__container", style: {
511
- height: this.containerHeight,
512
- overflowY: 'auto',
513
- position: 'relative'
514
- }, ref: (el) => (this.scrollContainer = el), onTouchStart: this.handleTouchStart, onTouchMove: this.handleTouchMove, onTouchEnd: this.handleTouchEnd }, index.h("div", { key: 'c43a2673188fbb50c93637f766f1926301ba08e9', class: "ptr-indicator", style: Object.assign(Object.assign({}, contentTransform), { position: 'absolute', top: '0', left: '0', width: '100%', height: `${this.pullTriggerDistance}px`, display: 'flex', alignItems: 'center', justifyContent: 'center', marginTop: `-${this.pullTriggerDistance}px`, pointerEvents: 'none' }) }, this.isRefreshing ? (index.h("slot", { name: "refresh-loading" }, translate$2('refreshing', this.language))) : (index.h("slot", { name: "pull-hint" }, this.pullDistance > this.pullTriggerDistance
515
- ? translate$2('release', this.language)
516
- : translate$2('pull', this.language)))), index.h("div", { key: 'b6a6334401bb3c0ea8d776e028f57836ee0d36ac', class: "scroll-content-wrapper", style: contentTransform }, index.h("div", { key: '16f58f44ce104fbdc4eacb2c3dfa9d3c7c7e6bdb', class: "list-content", style: listStyle }, listToRender.map((item, index$1) => (index.h("div", { key: index$1, class: "list-item-wrapper" }, showSkeleton ? this.renderSkeleton(index$1) : this.renderItem(item, index$1))))), index.h("div", { key: '1ed8b2ce72d85a68a48e9330ad2b9b9194346dfb', class: "lottery-infinite-scroll__sentinel", ref: (el) => (this.sentinel = el), style: {
517
- height: '20px',
518
- display: 'flex',
519
- justifyContent: 'center',
520
- visibility: this.hasMore || (this.isLoading && !showSkeleton) ? 'visible' : 'hidden'
521
- } }, this.isLoading ? index.h("slot", { name: "loading-more" }, translate$2('loading', this.language)) : null), !this.hasMore && !this.isLoading && items.length > 0 && (index.h("div", { key: '3b8207a9dc1451c683eb1920b798574be4fbd975', class: "end-message", style: { textAlign: 'center', padding: '10px' } }, index.h("slot", { key: '157e109d933e5613cf882c5dd01212647bfeba79', name: "end-message" }, translate$2('noMoreData', this.language)))))));
522
- }
523
- get el() { return index.getElement(this); }
524
- static get watchers() { return {
525
- "clientStyling": ["handleClientStylingChange"],
526
- "clientStylingUrl": ["handleClientStylingUrlChange"],
527
- "mbSource": ["handleMbSourceChange"],
528
- "isRefreshing": ["handleRefreshingChange"]
529
- }; }
319
+ var __assign = (undefined && undefined.__assign) || function () {
320
+ __assign = Object.assign || function(t) {
321
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
322
+ s = arguments[i];
323
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
324
+ t[p] = s[p];
325
+ }
326
+ return t;
327
+ };
328
+ return __assign.apply(this, arguments);
329
+ };
330
+ var defaultColors = {
331
+ primaryColor: '#333',
332
+ secondaryColor: '#E6E6E6'
530
333
  };
531
- LotteryInfiniteScroll.style = LotteryInfiniteScrollStyle0;
334
+ function renderIconDefinitionToSVGElement(icond, options) {
335
+ if (options === void 0) { options = {}; }
336
+ if (typeof icond.icon === 'function') {
337
+ // two-tone
338
+ var placeholders = options.placeholders || defaultColors;
339
+ return renderAbstractNodeToSVGElement(icond.icon(placeholders.primaryColor, placeholders.secondaryColor), options);
340
+ }
341
+ // fill, outline
342
+ return renderAbstractNodeToSVGElement(icond.icon, options);
343
+ }
344
+ function renderAbstractNodeToSVGElement(node, options) {
345
+ var targetAttrs = node.tag === 'svg'
346
+ ? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
347
+ var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
348
+ var key = nextKey;
349
+ var value = targetAttrs[key];
350
+ var token = "".concat(key, "=\"").concat(value, "\"");
351
+ acc.push(token);
352
+ return acc;
353
+ }, []);
354
+ var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
355
+ var children = (node.children || [])
356
+ .map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
357
+ .join('');
358
+ if (children && children.length) {
359
+ return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
360
+ }
361
+ return "<".concat(node.tag).concat(attrsToken, " />");
362
+ }
532
363
 
533
364
  // Basic sanitization method for SVG content
534
365
  // This is NOT a complete XSS prevention for SVG, but prevents common attacks.
@@ -561,27 +392,27 @@ const LotterySelection = class {
561
392
  }
562
393
  handleClientStylingChange(newValue, oldValue) {
563
394
  if (newValue !== oldValue) {
564
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
395
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
565
396
  }
566
397
  }
567
398
  handleClientStylingUrlChange(newValue, oldValue) {
568
399
  if (newValue !== oldValue) {
569
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
400
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
570
401
  }
571
402
  }
572
403
  handleMbSourceChange(newValue, oldValue) {
573
404
  if (newValue !== oldValue) {
574
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
405
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
575
406
  }
576
407
  }
577
408
  componentDidLoad() {
578
409
  if (this.stylingContainer) {
579
410
  if (this.mbSource)
580
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
411
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
581
412
  if (this.clientStyling)
582
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
413
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
583
414
  if (this.clientStylingUrl)
584
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
415
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
585
416
  }
586
417
  }
587
418
  disconnectedCallback() {
@@ -605,7 +436,7 @@ const LotterySelection = class {
605
436
  iconToRender = sanitizeSvg(this.deleteIconSvg);
606
437
  }
607
438
  else {
608
- iconToRender = lotteryHakunaTicketHistory.renderIconDefinitionToSVGElement(DeleteFilled$1, {
439
+ iconToRender = renderIconDefinitionToSVGElement(DeleteFilled$1, {
609
440
  extraSVGAttrs: {
610
441
  width: this.deleteIconWidth,
611
442
  height: this.deleteIconHeight,
@@ -811,17 +642,17 @@ const LotterySelectionGroup = class {
811
642
  }
812
643
  handleClientStylingChange(newValue, oldValue) {
813
644
  if (newValue != oldValue) {
814
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
645
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
815
646
  }
816
647
  }
817
648
  handleClientStylingUrlChange(newValue, oldValue) {
818
649
  if (newValue != oldValue) {
819
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
650
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
820
651
  }
821
652
  }
822
653
  handleMbSourceChange(newValue, oldValue) {
823
654
  if (newValue != oldValue) {
824
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
655
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
825
656
  }
826
657
  }
827
658
  componentWillLoad() {
@@ -832,11 +663,11 @@ const LotterySelectionGroup = class {
832
663
  componentDidLoad() {
833
664
  if (this.stylingContainer) {
834
665
  if (this.mbSource)
835
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
666
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
836
667
  if (this.clientStyling)
837
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
668
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
838
669
  if (this.clientStylingUrl)
839
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
670
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
840
671
  }
841
672
  }
842
673
  disconnectedCallback() {
@@ -1126,17 +957,17 @@ const LotteryTippingDialog = class {
1126
957
  }
1127
958
  handleClientStylingChange(newValue, oldValue) {
1128
959
  if (newValue != oldValue) {
1129
- lotteryHakunaTicketHistory.setClientStyling(this.stylingContainer, this.clientStyling);
960
+ index$1.setClientStyling(this.stylingContainer, this.clientStyling);
1130
961
  }
1131
962
  }
1132
963
  handleClientStylingUrlChange(newValue, oldValue) {
1133
964
  if (newValue != oldValue) {
1134
- lotteryHakunaTicketHistory.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
965
+ index$1.setClientStylingURL(this.stylingContainer, this.clientStylingUrl);
1135
966
  }
1136
967
  }
1137
968
  handleMbSourceChange(newValue, oldValue) {
1138
969
  if (newValue != oldValue) {
1139
- lotteryHakunaTicketHistory.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
970
+ index$1.setStreamStyling(this.stylingContainer, `${this.mbSource}.Style`);
1140
971
  }
1141
972
  }
1142
973
  componentWillLoad() {
@@ -1378,7 +1209,6 @@ UiSkeleton.style = UiSkeletonStyle0;
1378
1209
  exports.lottery_hakuna_ticket_history = lotteryHakunaTicketHistory.LotteryHakunaTicketHistory;
1379
1210
  exports.lottery_button = LotteryButton;
1380
1211
  exports.lottery_hakuna_ticket_history_item = LotteryHakunaTicketHistoryItem;
1381
- exports.lottery_infinite_scroll = LotteryInfiniteScroll;
1382
1212
  exports.lottery_selection = LotterySelection;
1383
1213
  exports.lottery_selection_group = LotterySelectionGroup;
1384
1214
  exports.lottery_tipping_dialog = LotteryTippingDialog;