@everymatrix/casino-engagement-suite-challenges-details 1.44.0 → 1.45.0

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 (57) hide show
  1. package/dist/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.esm.js +1 -1
  2. package/dist/casino-engagement-suite-challenges-details/p-11d8b487.js +2 -0
  3. package/dist/casino-engagement-suite-challenges-details/p-8bbfff73.entry.js +1 -0
  4. package/dist/casino-engagement-suite-challenges-details/p-e1255160.js +1 -0
  5. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  6. package/dist/cjs/casino-engagement-suite-challenges-details.cjs.js +17 -11
  7. package/dist/cjs/casino-engagement-suite-challenges-details_2.cjs.entry.js +293 -323
  8. package/dist/cjs/index-a758ba24.js +1249 -0
  9. package/dist/cjs/loader.cjs.js +7 -13
  10. package/dist/collection/collection-manifest.json +3 -3
  11. package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.css +63 -61
  12. package/dist/collection/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.js +438 -493
  13. package/dist/collection/components/casino-engagement-suite-challenges-details/index.js +1 -0
  14. package/dist/collection/models/casino-challenges-details.js +10 -10
  15. package/dist/collection/utils/index.js +8 -2
  16. package/dist/collection/utils/locale.utils.js +18 -18
  17. package/dist/collection/utils/utils.js +3 -0
  18. package/dist/esm/app-globals-0f993ce5.js +3 -0
  19. package/dist/esm/casino-engagement-suite-challenges-details.js +14 -11
  20. package/dist/esm/casino-engagement-suite-challenges-details_2.entry.js +293 -323
  21. package/dist/esm/index-c193b756.js +1221 -0
  22. package/dist/esm/loader.js +7 -13
  23. package/dist/stencil.config.dev.js +17 -0
  24. package/dist/stencil.config.js +14 -19
  25. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-details/.stencil/packages/stencil/casino-engagement-suite-challenges-details/stencil.config.d.ts +2 -0
  26. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-monorepo/packages/stencil/casino-engagement-suite-challenges-details/.stencil/packages/stencil/casino-engagement-suite-challenges-details/stencil.config.dev.d.ts +2 -0
  27. package/dist/types/components/casino-engagement-suite-challenges-details/casino-engagement-suite-challenges-details.d.ts +70 -70
  28. package/dist/types/components/casino-engagement-suite-challenges-details/index.d.ts +1 -0
  29. package/dist/types/components.d.ts +21 -3
  30. package/dist/types/models/casino-challenges-details.d.ts +46 -46
  31. package/dist/types/stencil-public-runtime.d.ts +142 -33
  32. package/dist/types/utils/index.d.ts +1 -0
  33. package/dist/types/utils/utils.d.ts +1 -0
  34. package/loader/cdn.js +1 -3
  35. package/loader/index.cjs.js +1 -3
  36. package/loader/index.d.ts +13 -1
  37. package/loader/index.es2017.js +1 -3
  38. package/loader/index.js +1 -3
  39. package/loader/package.json +1 -0
  40. package/package.json +12 -2
  41. package/dist/casino-engagement-suite-challenges-details/p-80848cd8.entry.js +0 -1
  42. package/dist/casino-engagement-suite-challenges-details/p-808a7dc5.js +0 -1
  43. package/dist/cjs/index-a0eb9215.js +0 -1279
  44. package/dist/components/casino-engagement-suite-challenges-details.d.ts +0 -11
  45. package/dist/components/casino-engagement-suite-challenges-details.js +0 -318
  46. package/dist/components/casino-engagement-suite-progress-bar.js +0 -6
  47. package/dist/components/casino-engagement-suite-progress-bar2.js +0 -107
  48. package/dist/components/index.d.ts +0 -26
  49. package/dist/components/index.js +0 -1
  50. package/dist/esm/index-c5abae48.js +0 -1252
  51. package/dist/esm/polyfills/core-js.js +0 -11
  52. package/dist/esm/polyfills/css-shim.js +0 -1
  53. package/dist/esm/polyfills/dom.js +0 -79
  54. package/dist/esm/polyfills/es5-html-element.js +0 -1
  55. package/dist/esm/polyfills/index.js +0 -34
  56. package/dist/esm/polyfills/system.js +0 -6
  57. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/casino-engagement-suite-challenges-details/.stencil/packages/casino-engagement-suite-challenges-details/stencil.config.d.ts +0 -2
@@ -1,1252 +0,0 @@
1
- const NAMESPACE = 'casino-engagement-suite-challenges-details';
2
-
3
- let scopeId;
4
- let hostTagName;
5
- let isSvgMode = false;
6
- let queuePending = false;
7
- const win = typeof window !== 'undefined' ? window : {};
8
- const doc = win.document || { head: {} };
9
- const plt = {
10
- $flags$: 0,
11
- $resourcesUrl$: '',
12
- jmp: (h) => h(),
13
- raf: (h) => requestAnimationFrame(h),
14
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
15
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
16
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
17
- };
18
- const promiseResolve = (v) => Promise.resolve(v);
19
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
20
- try {
21
- new CSSStyleSheet();
22
- return typeof new CSSStyleSheet().replace === 'function';
23
- }
24
- catch (e) { }
25
- return false;
26
- })()
27
- ;
28
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
29
- const createTime = (fnName, tagName = '') => {
30
- {
31
- return () => {
32
- return;
33
- };
34
- }
35
- };
36
- const uniqueTime = (key, measureText) => {
37
- {
38
- return () => {
39
- return;
40
- };
41
- }
42
- };
43
- const rootAppliedStyles = new WeakMap();
44
- const registerStyle = (scopeId, cssText, allowCS) => {
45
- let style = styles.get(scopeId);
46
- if (supportsConstructibleStylesheets && allowCS) {
47
- style = (style || new CSSStyleSheet());
48
- style.replace(cssText);
49
- }
50
- else {
51
- style = cssText;
52
- }
53
- styles.set(scopeId, style);
54
- };
55
- const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
56
- let scopeId = getScopeId(cmpMeta);
57
- let style = styles.get(scopeId);
58
- // if an element is NOT connected then getRootNode() will return the wrong root node
59
- // so the fallback is to always use the document for the root node in those cases
60
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
61
- if (style) {
62
- if (typeof style === 'string') {
63
- styleContainerNode = styleContainerNode.head || styleContainerNode;
64
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
65
- let styleElm;
66
- if (!appliedStyles) {
67
- rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
68
- }
69
- if (!appliedStyles.has(scopeId)) {
70
- {
71
- {
72
- styleElm = doc.createElement('style');
73
- styleElm.innerHTML = style;
74
- }
75
- styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
76
- }
77
- if (appliedStyles) {
78
- appliedStyles.add(scopeId);
79
- }
80
- }
81
- }
82
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
83
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
84
- }
85
- }
86
- return scopeId;
87
- };
88
- const attachStyles = (hostRef) => {
89
- const cmpMeta = hostRef.$cmpMeta$;
90
- const elm = hostRef.$hostElement$;
91
- const flags = cmpMeta.$flags$;
92
- const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
93
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
94
- if (flags & 10 /* needsScopedEncapsulation */) {
95
- // only required when we're NOT using native shadow dom (slot)
96
- // or this browser doesn't support native shadow dom
97
- // and this host element was NOT created with SSR
98
- // let's pick out the inner content for slot projection
99
- // create a node to represent where the original
100
- // content was first placed, which is useful later on
101
- // DOM WRITE!!
102
- elm['s-sc'] = scopeId;
103
- elm.classList.add(scopeId + '-h');
104
- }
105
- endAttachStyles();
106
- };
107
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
108
- /**
109
- * Default style mode id
110
- */
111
- /**
112
- * Reusable empty obj/array
113
- * Don't add values to these!!
114
- */
115
- const EMPTY_OBJ = {};
116
- const isDef = (v) => v != null;
117
- const isComplexType = (o) => {
118
- // https://jsperf.com/typeof-fn-object/5
119
- o = typeof o;
120
- return o === 'object' || o === 'function';
121
- };
122
- /**
123
- * Production h() function based on Preact by
124
- * Jason Miller (@developit)
125
- * Licensed under the MIT License
126
- * https://github.com/developit/preact/blob/master/LICENSE
127
- *
128
- * Modified for Stencil's compiler and vdom
129
- */
130
- // const stack: any[] = [];
131
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
132
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
133
- const h = (nodeName, vnodeData, ...children) => {
134
- let child = null;
135
- let key = null;
136
- let simple = false;
137
- let lastSimple = false;
138
- let vNodeChildren = [];
139
- const walk = (c) => {
140
- for (let i = 0; i < c.length; i++) {
141
- child = c[i];
142
- if (Array.isArray(child)) {
143
- walk(child);
144
- }
145
- else if (child != null && typeof child !== 'boolean') {
146
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
147
- child = String(child);
148
- }
149
- if (simple && lastSimple) {
150
- // If the previous child was simple (string), we merge both
151
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
152
- }
153
- else {
154
- // Append a new vNode, if it's text, we create a text vNode
155
- vNodeChildren.push(simple ? newVNode(null, child) : child);
156
- }
157
- lastSimple = simple;
158
- }
159
- }
160
- };
161
- walk(children);
162
- if (vnodeData) {
163
- // normalize class / classname attributes
164
- if (vnodeData.key) {
165
- key = vnodeData.key;
166
- }
167
- {
168
- const classData = vnodeData.className || vnodeData.class;
169
- if (classData) {
170
- vnodeData.class =
171
- typeof classData !== 'object'
172
- ? classData
173
- : Object.keys(classData)
174
- .filter((k) => classData[k])
175
- .join(' ');
176
- }
177
- }
178
- }
179
- const vnode = newVNode(nodeName, null);
180
- vnode.$attrs$ = vnodeData;
181
- if (vNodeChildren.length > 0) {
182
- vnode.$children$ = vNodeChildren;
183
- }
184
- {
185
- vnode.$key$ = key;
186
- }
187
- return vnode;
188
- };
189
- const newVNode = (tag, text) => {
190
- const vnode = {
191
- $flags$: 0,
192
- $tag$: tag,
193
- $text$: text,
194
- $elm$: null,
195
- $children$: null,
196
- };
197
- {
198
- vnode.$attrs$ = null;
199
- }
200
- {
201
- vnode.$key$ = null;
202
- }
203
- return vnode;
204
- };
205
- const Host = {};
206
- const isHost = (node) => node && node.$tag$ === Host;
207
- /**
208
- * Production setAccessor() function based on Preact by
209
- * Jason Miller (@developit)
210
- * Licensed under the MIT License
211
- * https://github.com/developit/preact/blob/master/LICENSE
212
- *
213
- * Modified for Stencil's compiler and vdom
214
- */
215
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
216
- if (oldValue !== newValue) {
217
- let isProp = isMemberInElement(elm, memberName);
218
- let ln = memberName.toLowerCase();
219
- if (memberName === 'class') {
220
- const classList = elm.classList;
221
- const oldClasses = parseClassList(oldValue);
222
- const newClasses = parseClassList(newValue);
223
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
224
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
225
- }
226
- else if (memberName === 'style') {
227
- // update style attribute, css properties and values
228
- {
229
- for (const prop in oldValue) {
230
- if (!newValue || newValue[prop] == null) {
231
- if (prop.includes('-')) {
232
- elm.style.removeProperty(prop);
233
- }
234
- else {
235
- elm.style[prop] = '';
236
- }
237
- }
238
- }
239
- }
240
- for (const prop in newValue) {
241
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
242
- if (prop.includes('-')) {
243
- elm.style.setProperty(prop, newValue[prop]);
244
- }
245
- else {
246
- elm.style[prop] = newValue[prop];
247
- }
248
- }
249
- }
250
- }
251
- else if (memberName === 'key')
252
- ;
253
- else if ((!isProp ) &&
254
- memberName[0] === 'o' &&
255
- memberName[1] === 'n') {
256
- // Event Handlers
257
- // so if the member name starts with "on" and the 3rd characters is
258
- // a capital letter, and it's not already a member on the element,
259
- // then we're assuming it's an event listener
260
- if (memberName[2] === '-') {
261
- // on- prefixed events
262
- // allows to be explicit about the dom event to listen without any magic
263
- // under the hood:
264
- // <my-cmp on-click> // listens for "click"
265
- // <my-cmp on-Click> // listens for "Click"
266
- // <my-cmp on-ionChange> // listens for "ionChange"
267
- // <my-cmp on-EVENTS> // listens for "EVENTS"
268
- memberName = memberName.slice(3);
269
- }
270
- else if (isMemberInElement(win, ln)) {
271
- // standard event
272
- // the JSX attribute could have been "onMouseOver" and the
273
- // member name "onmouseover" is on the window's prototype
274
- // so let's add the listener "mouseover", which is all lowercased
275
- memberName = ln.slice(2);
276
- }
277
- else {
278
- // custom event
279
- // the JSX attribute could have been "onMyCustomEvent"
280
- // so let's trim off the "on" prefix and lowercase the first character
281
- // and add the listener "myCustomEvent"
282
- // except for the first character, we keep the event name case
283
- memberName = ln[2] + memberName.slice(3);
284
- }
285
- if (oldValue) {
286
- plt.rel(elm, memberName, oldValue, false);
287
- }
288
- if (newValue) {
289
- plt.ael(elm, memberName, newValue, false);
290
- }
291
- }
292
- else {
293
- // Set property if it exists and it's not a SVG
294
- const isComplex = isComplexType(newValue);
295
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
296
- try {
297
- if (!elm.tagName.includes('-')) {
298
- let n = newValue == null ? '' : newValue;
299
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
300
- if (memberName === 'list') {
301
- isProp = false;
302
- }
303
- else if (oldValue == null || elm[memberName] != n) {
304
- elm[memberName] = n;
305
- }
306
- }
307
- else {
308
- elm[memberName] = newValue;
309
- }
310
- }
311
- catch (e) { }
312
- }
313
- if (newValue == null || newValue === false) {
314
- if (newValue !== false || elm.getAttribute(memberName) === '') {
315
- {
316
- elm.removeAttribute(memberName);
317
- }
318
- }
319
- }
320
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
321
- newValue = newValue === true ? '' : newValue;
322
- {
323
- elm.setAttribute(memberName, newValue);
324
- }
325
- }
326
- }
327
- }
328
- };
329
- const parseClassListRegex = /\s/;
330
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
331
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
332
- // if the element passed in is a shadow root, which is a document fragment
333
- // then we want to be adding attrs/props to the shadow root's "host" element
334
- // if it's not a shadow root, then we add attrs/props to the same element
335
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
336
- ? newVnode.$elm$.host
337
- : newVnode.$elm$;
338
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
339
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
340
- {
341
- // remove attributes no longer present on the vnode by setting them to undefined
342
- for (memberName in oldVnodeAttrs) {
343
- if (!(memberName in newVnodeAttrs)) {
344
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
345
- }
346
- }
347
- }
348
- // add new & update changed attributes
349
- for (memberName in newVnodeAttrs) {
350
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
351
- }
352
- };
353
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
354
- // tslint:disable-next-line: prefer-const
355
- let newVNode = newParentVNode.$children$[childIndex];
356
- let i = 0;
357
- let elm;
358
- let childNode;
359
- if (newVNode.$text$ !== null) {
360
- // create text node
361
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
362
- }
363
- else {
364
- // create element
365
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
366
- // add css classes, attrs, props, listeners, etc.
367
- {
368
- updateElement(null, newVNode, isSvgMode);
369
- }
370
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
371
- // if there is a scopeId and this is the initial render
372
- // then let's add the scopeId as a css class
373
- elm.classList.add((elm['s-si'] = scopeId));
374
- }
375
- if (newVNode.$children$) {
376
- for (i = 0; i < newVNode.$children$.length; ++i) {
377
- // create the node
378
- childNode = createElm(oldParentVNode, newVNode, i);
379
- // return node could have been null
380
- if (childNode) {
381
- // append our new node
382
- elm.appendChild(childNode);
383
- }
384
- }
385
- }
386
- }
387
- return elm;
388
- };
389
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
390
- let containerElm = (parentElm);
391
- let childNode;
392
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
393
- containerElm = containerElm.shadowRoot;
394
- }
395
- for (; startIdx <= endIdx; ++startIdx) {
396
- if (vnodes[startIdx]) {
397
- childNode = createElm(null, parentVNode, startIdx);
398
- if (childNode) {
399
- vnodes[startIdx].$elm$ = childNode;
400
- containerElm.insertBefore(childNode, before);
401
- }
402
- }
403
- }
404
- };
405
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
406
- for (; startIdx <= endIdx; ++startIdx) {
407
- if ((vnode = vnodes[startIdx])) {
408
- elm = vnode.$elm$;
409
- // remove the vnode's element from the dom
410
- elm.remove();
411
- }
412
- }
413
- };
414
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
415
- let oldStartIdx = 0;
416
- let newStartIdx = 0;
417
- let idxInOld = 0;
418
- let i = 0;
419
- let oldEndIdx = oldCh.length - 1;
420
- let oldStartVnode = oldCh[0];
421
- let oldEndVnode = oldCh[oldEndIdx];
422
- let newEndIdx = newCh.length - 1;
423
- let newStartVnode = newCh[0];
424
- let newEndVnode = newCh[newEndIdx];
425
- let node;
426
- let elmToMove;
427
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
428
- if (oldStartVnode == null) {
429
- // Vnode might have been moved left
430
- oldStartVnode = oldCh[++oldStartIdx];
431
- }
432
- else if (oldEndVnode == null) {
433
- oldEndVnode = oldCh[--oldEndIdx];
434
- }
435
- else if (newStartVnode == null) {
436
- newStartVnode = newCh[++newStartIdx];
437
- }
438
- else if (newEndVnode == null) {
439
- newEndVnode = newCh[--newEndIdx];
440
- }
441
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
442
- patch(oldStartVnode, newStartVnode);
443
- oldStartVnode = oldCh[++oldStartIdx];
444
- newStartVnode = newCh[++newStartIdx];
445
- }
446
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
447
- patch(oldEndVnode, newEndVnode);
448
- oldEndVnode = oldCh[--oldEndIdx];
449
- newEndVnode = newCh[--newEndIdx];
450
- }
451
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
452
- patch(oldStartVnode, newEndVnode);
453
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
454
- oldStartVnode = oldCh[++oldStartIdx];
455
- newEndVnode = newCh[--newEndIdx];
456
- }
457
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
458
- patch(oldEndVnode, newStartVnode);
459
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
460
- oldEndVnode = oldCh[--oldEndIdx];
461
- newStartVnode = newCh[++newStartIdx];
462
- }
463
- else {
464
- // createKeyToOldIdx
465
- idxInOld = -1;
466
- {
467
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
468
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
469
- idxInOld = i;
470
- break;
471
- }
472
- }
473
- }
474
- if (idxInOld >= 0) {
475
- elmToMove = oldCh[idxInOld];
476
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
477
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
478
- }
479
- else {
480
- patch(elmToMove, newStartVnode);
481
- oldCh[idxInOld] = undefined;
482
- node = elmToMove.$elm$;
483
- }
484
- newStartVnode = newCh[++newStartIdx];
485
- }
486
- else {
487
- // new element
488
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
489
- newStartVnode = newCh[++newStartIdx];
490
- }
491
- if (node) {
492
- {
493
- oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
494
- }
495
- }
496
- }
497
- }
498
- if (oldStartIdx > oldEndIdx) {
499
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
500
- }
501
- else if (newStartIdx > newEndIdx) {
502
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
503
- }
504
- };
505
- const isSameVnode = (vnode1, vnode2) => {
506
- // compare if two vnode to see if they're "technically" the same
507
- // need to have the same element tag, and same key to be the same
508
- if (vnode1.$tag$ === vnode2.$tag$) {
509
- {
510
- return vnode1.$key$ === vnode2.$key$;
511
- }
512
- }
513
- return false;
514
- };
515
- const patch = (oldVNode, newVNode) => {
516
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
517
- const oldChildren = oldVNode.$children$;
518
- const newChildren = newVNode.$children$;
519
- const tag = newVNode.$tag$;
520
- const text = newVNode.$text$;
521
- if (text === null) {
522
- // element node
523
- {
524
- if (tag === 'slot')
525
- ;
526
- else {
527
- // either this is the first render of an element OR it's an update
528
- // AND we already know it's possible it could have changed
529
- // this updates the element's css classes, attrs, props, listeners, etc.
530
- updateElement(oldVNode, newVNode, isSvgMode);
531
- }
532
- }
533
- if (oldChildren !== null && newChildren !== null) {
534
- // looks like there's child vnodes for both the old and new vnodes
535
- updateChildren(elm, oldChildren, newVNode, newChildren);
536
- }
537
- else if (newChildren !== null) {
538
- // no old child vnodes, but there are new child vnodes to add
539
- if (oldVNode.$text$ !== null) {
540
- // the old vnode was text, so be sure to clear it out
541
- elm.textContent = '';
542
- }
543
- // add the new vnode children
544
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
545
- }
546
- else if (oldChildren !== null) {
547
- // no new child vnodes, but there are old child vnodes to remove
548
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
549
- }
550
- }
551
- else if (oldVNode.$text$ !== text) {
552
- // update the text content for the text only vnode
553
- // and also only if the text is different than before
554
- elm.data = text;
555
- }
556
- };
557
- const renderVdom = (hostRef, renderFnResults) => {
558
- const hostElm = hostRef.$hostElement$;
559
- const cmpMeta = hostRef.$cmpMeta$;
560
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
561
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
562
- hostTagName = hostElm.tagName;
563
- if (cmpMeta.$attrsToReflect$) {
564
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
565
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
566
- }
567
- rootVnode.$tag$ = null;
568
- rootVnode.$flags$ |= 4 /* isHost */;
569
- hostRef.$vnode$ = rootVnode;
570
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
571
- {
572
- scopeId = hostElm['s-sc'];
573
- }
574
- // synchronous patch
575
- patch(oldVNode, rootVnode);
576
- };
577
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
578
- const createEvent = (ref, name, flags) => {
579
- const elm = getElement(ref);
580
- return {
581
- emit: (detail) => {
582
- return emitEvent(elm, name, {
583
- bubbles: !!(flags & 4 /* Bubbles */),
584
- composed: !!(flags & 2 /* Composed */),
585
- cancelable: !!(flags & 1 /* Cancellable */),
586
- detail,
587
- });
588
- },
589
- };
590
- };
591
- /**
592
- * Helper function to create & dispatch a custom Event on a provided target
593
- * @param elm the target of the Event
594
- * @param name the name to give the custom Event
595
- * @param opts options for configuring a custom Event
596
- * @returns the custom Event
597
- */
598
- const emitEvent = (elm, name, opts) => {
599
- const ev = plt.ce(name, opts);
600
- elm.dispatchEvent(ev);
601
- return ev;
602
- };
603
- const attachToAncestor = (hostRef, ancestorComponent) => {
604
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
605
- ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
606
- }
607
- };
608
- const scheduleUpdate = (hostRef, isInitialLoad) => {
609
- {
610
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
611
- }
612
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
613
- hostRef.$flags$ |= 512 /* needsRerender */;
614
- return;
615
- }
616
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
617
- // there is no ancestor component or the ancestor component
618
- // has already fired off its lifecycle update then
619
- // fire off the initial update
620
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
621
- return writeTask(dispatch) ;
622
- };
623
- const dispatchHooks = (hostRef, isInitialLoad) => {
624
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
625
- const instance = hostRef.$lazyInstance$ ;
626
- let promise;
627
- if (isInitialLoad) {
628
- {
629
- promise = safeCall(instance, 'componentWillLoad');
630
- }
631
- }
632
- endSchedule();
633
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
634
- };
635
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
636
- // updateComponent
637
- const elm = hostRef.$hostElement$;
638
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
639
- const rc = elm['s-rc'];
640
- if (isInitialLoad) {
641
- // DOM WRITE!
642
- attachStyles(hostRef);
643
- }
644
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
645
- {
646
- callRender(hostRef, instance);
647
- }
648
- if (rc) {
649
- // ok, so turns out there are some child host elements
650
- // waiting on this parent element to load
651
- // let's fire off all update callbacks waiting
652
- rc.map((cb) => cb());
653
- elm['s-rc'] = undefined;
654
- }
655
- endRender();
656
- endUpdate();
657
- {
658
- const childrenPromises = elm['s-p'];
659
- const postUpdate = () => postUpdateComponent(hostRef);
660
- if (childrenPromises.length === 0) {
661
- postUpdate();
662
- }
663
- else {
664
- Promise.all(childrenPromises).then(postUpdate);
665
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
666
- childrenPromises.length = 0;
667
- }
668
- }
669
- };
670
- const callRender = (hostRef, instance, elm) => {
671
- try {
672
- instance = instance.render() ;
673
- {
674
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
675
- }
676
- {
677
- hostRef.$flags$ |= 2 /* hasRendered */;
678
- }
679
- {
680
- {
681
- // looks like we've got child nodes to render into this host element
682
- // or we need to update the css class/attrs on the host element
683
- // DOM WRITE!
684
- {
685
- renderVdom(hostRef, instance);
686
- }
687
- }
688
- }
689
- }
690
- catch (e) {
691
- consoleError(e, hostRef.$hostElement$);
692
- }
693
- return null;
694
- };
695
- const postUpdateComponent = (hostRef) => {
696
- const tagName = hostRef.$cmpMeta$.$tagName$;
697
- const elm = hostRef.$hostElement$;
698
- const endPostUpdate = createTime('postUpdate', tagName);
699
- const instance = hostRef.$lazyInstance$ ;
700
- const ancestorComponent = hostRef.$ancestorComponent$;
701
- {
702
- safeCall(instance, 'componentDidRender');
703
- }
704
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
705
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
706
- {
707
- // DOM WRITE!
708
- addHydratedFlag(elm);
709
- }
710
- endPostUpdate();
711
- {
712
- hostRef.$onReadyResolve$(elm);
713
- if (!ancestorComponent) {
714
- appDidLoad();
715
- }
716
- }
717
- }
718
- else {
719
- endPostUpdate();
720
- }
721
- // load events fire from bottom to top
722
- // the deepest elements load first then bubbles up
723
- {
724
- if (hostRef.$onRenderResolve$) {
725
- hostRef.$onRenderResolve$();
726
- hostRef.$onRenderResolve$ = undefined;
727
- }
728
- if (hostRef.$flags$ & 512 /* needsRerender */) {
729
- nextTick(() => scheduleUpdate(hostRef, false));
730
- }
731
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
732
- }
733
- // ( •_•)
734
- // ( •_•)>⌐■-■
735
- // (⌐■_■)
736
- };
737
- const appDidLoad = (who) => {
738
- // on appload
739
- // we have finish the first big initial render
740
- {
741
- addHydratedFlag(doc.documentElement);
742
- }
743
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
744
- };
745
- const safeCall = (instance, method, arg) => {
746
- if (instance && instance[method]) {
747
- try {
748
- return instance[method](arg);
749
- }
750
- catch (e) {
751
- consoleError(e);
752
- }
753
- }
754
- return undefined;
755
- };
756
- const then = (promise, thenFn) => {
757
- return promise && promise.then ? promise.then(thenFn) : thenFn();
758
- };
759
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
760
- ;
761
- /**
762
- * Parse a new property value for a given property type.
763
- *
764
- * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
765
- * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
766
- * 1. `any`, the type given to `propValue` in the function signature
767
- * 2. the type stored from `propType`.
768
- *
769
- * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
770
- *
771
- * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
772
- * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
773
- * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
774
- * ```tsx
775
- * <my-cmp prop-val={0}></my-cmp>
776
- * ```
777
- *
778
- * HTML prop values on the other hand, will always a string
779
- *
780
- * @param propValue the new value to coerce to some type
781
- * @param propType the type of the prop, expressed as a binary number
782
- * @returns the parsed/coerced value
783
- */
784
- const parsePropertyValue = (propValue, propType) => {
785
- // ensure this value is of the correct prop type
786
- if (propValue != null && !isComplexType(propValue)) {
787
- if (propType & 4 /* Boolean */) {
788
- // per the HTML spec, any string value means it is a boolean true value
789
- // but we'll cheat here and say that the string "false" is the boolean false
790
- return propValue === 'false' ? false : propValue === '' || !!propValue;
791
- }
792
- if (propType & 2 /* Number */) {
793
- // force it to be a number
794
- return parseFloat(propValue);
795
- }
796
- if (propType & 1 /* String */) {
797
- // could have been passed as a number or boolean
798
- // but we still want it as a string
799
- return String(propValue);
800
- }
801
- // redundant return here for better minification
802
- return propValue;
803
- }
804
- // not sure exactly what type we want
805
- // so no need to change to a different type
806
- return propValue;
807
- };
808
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
809
- const setValue = (ref, propName, newVal, cmpMeta) => {
810
- // check our new property value against our internal value
811
- const hostRef = getHostRef(ref);
812
- const elm = hostRef.$hostElement$ ;
813
- const oldVal = hostRef.$instanceValues$.get(propName);
814
- const flags = hostRef.$flags$;
815
- const instance = hostRef.$lazyInstance$ ;
816
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
817
- // explicitly check for NaN on both sides, as `NaN === NaN` is always false
818
- const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
819
- const didValueChange = newVal !== oldVal && !areBothNaN;
820
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
821
- // gadzooks! the property's value has changed!!
822
- // set our new value!
823
- hostRef.$instanceValues$.set(propName, newVal);
824
- if (instance) {
825
- // get an array of method names of watch functions to call
826
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
827
- const watchMethods = cmpMeta.$watchers$[propName];
828
- if (watchMethods) {
829
- // this instance is watching for when this property changed
830
- watchMethods.map((watchMethodName) => {
831
- try {
832
- // fire off each of the watch methods that are watching this property
833
- instance[watchMethodName](newVal, oldVal, propName);
834
- }
835
- catch (e) {
836
- consoleError(e, elm);
837
- }
838
- });
839
- }
840
- }
841
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
842
- // looks like this value actually changed, so we've got work to do!
843
- // but only if we've already rendered, otherwise just chill out
844
- // queue that we need to do an update, but don't worry about queuing
845
- // up millions cuz this function ensures it only runs once
846
- scheduleUpdate(hostRef, false);
847
- }
848
- }
849
- }
850
- };
851
- const proxyComponent = (Cstr, cmpMeta, flags) => {
852
- if (cmpMeta.$members$) {
853
- if (Cstr.watchers) {
854
- cmpMeta.$watchers$ = Cstr.watchers;
855
- }
856
- // It's better to have a const than two Object.entries()
857
- const members = Object.entries(cmpMeta.$members$);
858
- const prototype = Cstr.prototype;
859
- members.map(([memberName, [memberFlags]]) => {
860
- if ((memberFlags & 31 /* Prop */ ||
861
- ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
862
- // proxyComponent - prop
863
- Object.defineProperty(prototype, memberName, {
864
- get() {
865
- // proxyComponent, get value
866
- return getValue(this, memberName);
867
- },
868
- set(newValue) {
869
- // proxyComponent, set value
870
- setValue(this, memberName, newValue, cmpMeta);
871
- },
872
- configurable: true,
873
- enumerable: true,
874
- });
875
- }
876
- });
877
- if ((flags & 1 /* isElementConstructor */)) {
878
- const attrNameToPropName = new Map();
879
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
880
- plt.jmp(() => {
881
- const propName = attrNameToPropName.get(attrName);
882
- // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
883
- // in the case where an attribute was set inline.
884
- // ```html
885
- // <my-component some-attribute="some-value"></my-component>
886
- // ```
887
- //
888
- // There is an edge case where a developer sets the attribute inline on a custom element and then
889
- // programmatically changes it before it has been upgraded as shown below:
890
- //
891
- // ```html
892
- // <!-- this component has _not_ been upgraded yet -->
893
- // <my-component id="test" some-attribute="some-value"></my-component>
894
- // <script>
895
- // // grab non-upgraded component
896
- // el = document.querySelector("#test");
897
- // el.someAttribute = "another-value";
898
- // // upgrade component
899
- // customElements.define('my-component', MyComponent);
900
- // </script>
901
- // ```
902
- // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
903
- // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
904
- // to the value that was set inline i.e. "some-value" from above example. When
905
- // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
906
- //
907
- // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
908
- // by connectedCallback as this attributeChangedCallback will not fire.
909
- //
910
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
911
- //
912
- // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
913
- // properties here given that this goes against best practices outlined here
914
- // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
915
- if (this.hasOwnProperty(propName)) {
916
- newValue = this[propName];
917
- delete this[propName];
918
- }
919
- else if (prototype.hasOwnProperty(propName) &&
920
- typeof this[propName] === 'number' &&
921
- this[propName] == newValue) {
922
- // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
923
- // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
924
- // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
925
- return;
926
- }
927
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
928
- });
929
- };
930
- // create an array of attributes to observe
931
- // and also create a map of html attribute name to js property name
932
- Cstr.observedAttributes = members
933
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
934
- .map(([propName, m]) => {
935
- const attrName = m[1] || propName;
936
- attrNameToPropName.set(attrName, propName);
937
- if (m[0] & 512 /* ReflectAttr */) {
938
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
939
- }
940
- return attrName;
941
- });
942
- }
943
- }
944
- return Cstr;
945
- };
946
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
947
- // initializeComponent
948
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
949
- {
950
- // we haven't initialized this element yet
951
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
952
- // lazy loaded components
953
- // request the component's implementation to be
954
- // wired up with the host element
955
- Cstr = loadModule(cmpMeta);
956
- if (Cstr.then) {
957
- // Await creates a micro-task avoid if possible
958
- const endLoad = uniqueTime();
959
- Cstr = await Cstr;
960
- endLoad();
961
- }
962
- if (!Cstr.isProxied) {
963
- // we've never proxied this Constructor before
964
- // let's add the getters/setters to its prototype before
965
- // the first time we create an instance of the implementation
966
- {
967
- cmpMeta.$watchers$ = Cstr.watchers;
968
- }
969
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
970
- Cstr.isProxied = true;
971
- }
972
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
973
- // ok, time to construct the instance
974
- // but let's keep track of when we start and stop
975
- // so that the getters/setters don't incorrectly step on data
976
- {
977
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
978
- }
979
- // construct the lazy-loaded component implementation
980
- // passing the hostRef is very important during
981
- // construction in order to directly wire together the
982
- // host element and the lazy-loaded instance
983
- try {
984
- new Cstr(hostRef);
985
- }
986
- catch (e) {
987
- consoleError(e);
988
- }
989
- {
990
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
991
- }
992
- {
993
- hostRef.$flags$ |= 128 /* isWatchReady */;
994
- }
995
- endNewInstance();
996
- }
997
- if (Cstr.style) {
998
- // this component has styles but we haven't registered them yet
999
- let style = Cstr.style;
1000
- const scopeId = getScopeId(cmpMeta);
1001
- if (!styles.has(scopeId)) {
1002
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1003
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1004
- endRegisterStyles();
1005
- }
1006
- }
1007
- }
1008
- // we've successfully created a lazy instance
1009
- const ancestorComponent = hostRef.$ancestorComponent$;
1010
- const schedule = () => scheduleUpdate(hostRef, true);
1011
- if (ancestorComponent && ancestorComponent['s-rc']) {
1012
- // this is the initial load and this component it has an ancestor component
1013
- // but the ancestor component has NOT fired its will update lifecycle yet
1014
- // so let's just cool our jets and wait for the ancestor to continue first
1015
- // this will get fired off when the ancestor component
1016
- // finally gets around to rendering its lazy self
1017
- // fire off the initial update
1018
- ancestorComponent['s-rc'].push(schedule);
1019
- }
1020
- else {
1021
- schedule();
1022
- }
1023
- };
1024
- const connectedCallback = (elm) => {
1025
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1026
- const hostRef = getHostRef(elm);
1027
- const cmpMeta = hostRef.$cmpMeta$;
1028
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1029
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1030
- // first time this component has connected
1031
- hostRef.$flags$ |= 1 /* hasConnected */;
1032
- {
1033
- // find the first ancestor component (if there is one) and register
1034
- // this component as one of the actively loading child components for its ancestor
1035
- let ancestorComponent = elm;
1036
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1037
- // climb up the ancestors looking for the first
1038
- // component that hasn't finished its lifecycle update yet
1039
- if (ancestorComponent['s-p']) {
1040
- // we found this components first ancestor component
1041
- // keep a reference to this component's ancestor component
1042
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1043
- break;
1044
- }
1045
- }
1046
- }
1047
- // Lazy properties
1048
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1049
- if (cmpMeta.$members$) {
1050
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1051
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1052
- const value = elm[memberName];
1053
- delete elm[memberName];
1054
- elm[memberName] = value;
1055
- }
1056
- });
1057
- }
1058
- {
1059
- initializeComponent(elm, hostRef, cmpMeta);
1060
- }
1061
- }
1062
- endConnected();
1063
- }
1064
- };
1065
- const disconnectedCallback = (elm) => {
1066
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1067
- const hostRef = getHostRef(elm);
1068
- const instance = hostRef.$lazyInstance$ ;
1069
- {
1070
- safeCall(instance, 'disconnectedCallback');
1071
- }
1072
- }
1073
- };
1074
- const bootstrapLazy = (lazyBundles, options = {}) => {
1075
- const endBootstrap = createTime();
1076
- const cmpTags = [];
1077
- const exclude = options.exclude || [];
1078
- const customElements = win.customElements;
1079
- const head = doc.head;
1080
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1081
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1082
- const deferredConnectedCallbacks = [];
1083
- let appLoadFallback;
1084
- let isBootstrapping = true;
1085
- Object.assign(plt, options);
1086
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1087
- lazyBundles.map((lazyBundle) => {
1088
- lazyBundle[1].map((compactMeta) => {
1089
- const cmpMeta = {
1090
- $flags$: compactMeta[0],
1091
- $tagName$: compactMeta[1],
1092
- $members$: compactMeta[2],
1093
- $listeners$: compactMeta[3],
1094
- };
1095
- {
1096
- cmpMeta.$members$ = compactMeta[2];
1097
- }
1098
- {
1099
- cmpMeta.$attrsToReflect$ = [];
1100
- }
1101
- {
1102
- cmpMeta.$watchers$ = {};
1103
- }
1104
- const tagName = cmpMeta.$tagName$;
1105
- const HostElement = class extends HTMLElement {
1106
- // StencilLazyHost
1107
- constructor(self) {
1108
- // @ts-ignore
1109
- super(self);
1110
- self = this;
1111
- registerHost(self, cmpMeta);
1112
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1113
- // this component is using shadow dom
1114
- // and this browser supports shadow dom
1115
- // add the read-only property "shadowRoot" to the host element
1116
- // adding the shadow root build conditionals to minimize runtime
1117
- {
1118
- {
1119
- self.attachShadow({ mode: 'open' });
1120
- }
1121
- }
1122
- }
1123
- }
1124
- connectedCallback() {
1125
- if (appLoadFallback) {
1126
- clearTimeout(appLoadFallback);
1127
- appLoadFallback = null;
1128
- }
1129
- if (isBootstrapping) {
1130
- // connectedCallback will be processed once all components have been registered
1131
- deferredConnectedCallbacks.push(this);
1132
- }
1133
- else {
1134
- plt.jmp(() => connectedCallback(this));
1135
- }
1136
- }
1137
- disconnectedCallback() {
1138
- plt.jmp(() => disconnectedCallback(this));
1139
- }
1140
- componentOnReady() {
1141
- return getHostRef(this).$onReadyPromise$;
1142
- }
1143
- };
1144
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1145
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1146
- cmpTags.push(tagName);
1147
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1148
- }
1149
- });
1150
- });
1151
- {
1152
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1153
- visibilityStyle.setAttribute('data-styles', '');
1154
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1155
- }
1156
- // Process deferred connectedCallbacks now all components have been registered
1157
- isBootstrapping = false;
1158
- if (deferredConnectedCallbacks.length) {
1159
- deferredConnectedCallbacks.map((host) => host.connectedCallback());
1160
- }
1161
- else {
1162
- {
1163
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1164
- }
1165
- }
1166
- // Fallback appLoad event
1167
- endBootstrap();
1168
- };
1169
- const hostRefs = new WeakMap();
1170
- const getHostRef = (ref) => hostRefs.get(ref);
1171
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1172
- const registerHost = (elm, cmpMeta) => {
1173
- const hostRef = {
1174
- $flags$: 0,
1175
- $hostElement$: elm,
1176
- $cmpMeta$: cmpMeta,
1177
- $instanceValues$: new Map(),
1178
- };
1179
- {
1180
- hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1181
- elm['s-p'] = [];
1182
- elm['s-rc'] = [];
1183
- }
1184
- return hostRefs.set(elm, hostRef);
1185
- };
1186
- const isMemberInElement = (elm, memberName) => memberName in elm;
1187
- const consoleError = (e, el) => (0, console.error)(e, el);
1188
- const cmpModules = /*@__PURE__*/ new Map();
1189
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1190
- // loadModuleImport
1191
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1192
- const bundleId = cmpMeta.$lazyBundleId$;
1193
- const module = cmpModules.get(bundleId) ;
1194
- if (module) {
1195
- return module[exportName];
1196
- }
1197
- return import(
1198
- /* webpackInclude: /\.entry\.js$/ */
1199
- /* webpackExclude: /\.system\.entry\.js$/ */
1200
- /* webpackMode: "lazy" */
1201
- `./${bundleId}.entry.js${''}`).then((importedModule) => {
1202
- {
1203
- cmpModules.set(bundleId, importedModule);
1204
- }
1205
- return importedModule[exportName];
1206
- }, consoleError);
1207
- };
1208
- const styles = new Map();
1209
- const queueDomReads = [];
1210
- const queueDomWrites = [];
1211
- const queueTask = (queue, write) => (cb) => {
1212
- queue.push(cb);
1213
- if (!queuePending) {
1214
- queuePending = true;
1215
- if (write && plt.$flags$ & 4 /* queueSync */) {
1216
- nextTick(flush);
1217
- }
1218
- else {
1219
- plt.raf(flush);
1220
- }
1221
- }
1222
- };
1223
- const consume = (queue) => {
1224
- for (let i = 0; i < queue.length; i++) {
1225
- try {
1226
- queue[i](performance.now());
1227
- }
1228
- catch (e) {
1229
- consoleError(e);
1230
- }
1231
- }
1232
- queue.length = 0;
1233
- };
1234
- const flush = () => {
1235
- // always force a bunch of medium callbacks to run, but still have
1236
- // a throttle on how many can run in a certain time
1237
- // DOM READS!!!
1238
- consume(queueDomReads);
1239
- // DOM WRITES!!!
1240
- {
1241
- consume(queueDomWrites);
1242
- if ((queuePending = queueDomReads.length > 0)) {
1243
- // still more to do yet, but we've run out of time
1244
- // let's let this thing cool off and try again in the next tick
1245
- plt.raf(flush);
1246
- }
1247
- }
1248
- };
1249
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1250
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1251
-
1252
- export { bootstrapLazy as b, createEvent as c, getElement as g, h, promiseResolve as p, registerInstance as r };