@everymatrix/casino-tournament-prizes 1.44.0 → 1.45.2

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