@everymatrix/casino-tournament-prizes 1.16.1

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